The ratio by mass for magnesium and sulphur in magnesium sulphide

The ratio by mass for magnesium and sulphur in magnesium sulphide is given as 3:4. Calculate the ratio by number of atoms for magnesium sulphide

Atomic mass of Mg = 24 g
Atomic mass of S = 32 g
Ratio of Mg and S in Mg S = 24:32 = 3:4
Mass ratio / Atomic mass of Mg = 3/24 = 1/8
Mass ratio / atomic mass of S = 4/32 = 1/8
Hence, the ratio of atoms in Mg S is = (1/8) : (1/8) = 1:1