#C9215. Count Repeated Letters
Count Repeated Letters
Count Repeated Letters
Given a list of words, your task is to count how many words contain at least one pair of consecutive identical letters.
The solution should read input from standard input (stdin) and write the output to standard output (stdout).
Note: A word is considered to have repeated letters if there exists at least one position i such that \( s_i = s_{i+1} \).
Example:
- Input:
4
→ Output:
hello world book tree3
- Input:
3
→ Output:
cat dog fish0
inputFormat
The first line of input contains an integer \( n \) indicating the number of words. The second line contains \( n \) space-separated strings representing the words.
outputFormat
Output a single integer representing the number of words that contain at least one pair of consecutive identical letters.
## sample4
hello world book tree
3