Calculating the number of ions in a solution