Question: how to know how many electrons are gained or lost?
Answer: Subtract the charge from the atomic number if the ion is positive. If the charge is positive, the ion has lost electrons. To determine how many electrons are left, subtract the amount of charge from the atomic number. In this case, there are more protons than electrons.