Calculation of the number of atoms