Change the numbers in front of each formula until the atoms balance.
Each group of ions is one unit of the formula. In a real ionic solid the ions are packed together in a giant lattice.