Magnesium loses how many electrons when forming a positive ion?