Counting a's (2) P67454


Statement
 

pdf   zip

html

Write a program that reads a sequence of characters and prints the number of letters ‘a’ in the sequence before the first period.

Input

Input consists of a sequence of characters with at least one period.

Output

Print the number of times that ‘a’ appears in the sequence before the first period.

Observation

The expected solution for the exercise P97969: “Counting a’s (1)” is also a correct solution for this exercise.

Public test cases
  • Input

    I am an instance with four a's.
    

    Output

    4
    
  • Input

    I just have one. Yes, exactly one.
    

    Output

    1
    
  • Input

    Absolutely none.
    

    Output

    0
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Pascal Python
    User solutions
    C++ Haskell Java Python