Equal to the last one P14130


Statement
 

pdf   zip

thehtml

Write a program that reads a non-empty sequence of integer numbers, and tells how many of them are equal to the last one.

Input

Input consists of a natural number n> 0, followed by n integer numbers.

Output

Print the number of elements that are equal to the last one, this one excluded.

Public test cases
  • Input

    9
    1 7 3 2 4 7 5 8 7
    

    Output

    2
    
  • Input

    5
    -3 10 0 -2 7
    

    Output

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