Counts the number of planets