Just one. Because from the way compounds are named and or written. The elements exchange their number of valence electron to complement each other. So, a magnesium of +2 and a Chlorine of -1 when exchanged would give the formula of
And as we can tell from the formula of the compound I just write down, Magnesium has just a single ion in it, while Chlorine has 2.
So the answer is 1.