#CCBCHBAHAI0000017. Đếm cặp kề nhau bằng nhau (Count Equal Adjacent Pairs)
Đếm cặp kề nhau bằng nhau (Count Equal Adjacent Pairs)
Count Equal Adjacent Pairs
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Given , count indices with and .
Input
Line 1 contains . Line 2 contains .
Output
Print the required integer answer.
Subtasks
Subtask 1 (20 points): ; .
Subtask 2 (30 points): ; .
Subtask 3 (50 points): ; .
Example
Input
8
1 1 2 2 2 3 4 4
Output
4
Explanation
The values follow directly from the definitions and illustrate the valid index range of the array scan.