You'd need to find the volume of a penny which is

where

- V = Volume
- D = Diameter
- h = thickness

Once you know the volume of a penny you can do

to get the number of pennies (n). That formula only works for measuring the penny's thickness and diameter/radius in mm

Bear in mind this will be an overestimate because it does not account for gaps between the pennies.