Exercise from siteduzero:  counting elements