Below you can see the front-view size comparison of the Panasonic ZS40 and Panasonic LS5. The Panasonic LS5 is clearly the smaller of the two cameras. Its body is 14 mm narrower, 2 mm shorter and 7 mm thinner than the Panasonic ZS40.
The chart below depicts how two cameras compare with average dimensions of the cameras in their class.