← Problem book: C
Lesson 71 of 96 · 10 XP
Equal neighbours
Theory and problem statement
Machine translation, not yet reviewed by a native speaker.
The first line contains the count of numbers n (1 ≤ n ≤ 100), the second — the n integers themselves, separated by spaces.
Print how many times two neighbouring numbers are equal to each other.
Example
Input:
5
1 1 2 2 2
Output:
3
Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.