Count the last word

Write a program that reads a sequence of words and prints how many times the last word appears.

Input

Input starts with a natural number n1n\ge1 that indicates how many words are coming. Then, there are nn words.

Output

Your program must print, in a line, how many times appears the last word of the sequence.

Observation

Use recursion (not tables).

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T12:08:30.535Z

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