The most efficient way to do this is to weigh a large amount of these items, and then derive the amount of parts by dividing the total weight by the individual weight.
Not only will your scale need to come with added corrosion resistance, you’ll also need to make sure that there is no way for the scale to become a source of ignition.