A loop and an if can count only the letters you care about:
if
What number does it print?
Enter a whole number.
Once you get it right, the reasoning behind the answer shows up here.