Count words that end with A U74417


Statement
 

pdf   zip

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.

Public test cases
  • Input

    ANA BANANA APPLE ORANGE MESA PAPA
    SILLA CASA UVA

    Output

    7
    
  • Input

    ANA BOLA CASA  
    PERA PLATANO  
    ZEBRA LLAMA  
    ALBA AURA  
    NINA TACA

    Output

    10
    
  • Information
    Author
    Jordi Petit
    Language
    English
    Official solutions
    Python
    User solutions