how many atoms are in 1 gram of magnesium