A loop can count things for you. Trace this one:
What number does it print?
Enter a whole number.
Once you get it right, the reasoning behind the answer shows up here.