Count words that end with A

Ana loves reading stories in different languages. She noticed that many important words in her favorite texts end with the letter A. Curious about this pattern, she wants to count how many words end with the letter A in a given text.

Write a program that reads a sequence of words and counts how many of them end with the uppercase letter A.

Input

The input consists of a sequence of words separated by spaces and/or newlines. Each word contains only uppercase letters AZ and has at least one letter. The input ends at end of file.

Output

Print a single integer indicating how many words end with the letter A.

Observation

This problem has been generated by JutgeAI^{\text{AI}}. Remove this observation after reviewing it carefully.

Problem information

Author: Jordi Petit

Generation: 2026-02-18T09:43:28.988Z

© Jutge.org, 2006–2026.
https://jutge.org