#include<bits/stdc++.h>
using namespace std;
int a[100];
int main(){
	int N, ans = 0;
	scanf("%d", &N);
	for(int i = 0; i < N; i += 1) scanf("%d", a + i);
	for(int i = 1; i < N; i += 1)
		if(a[i] == a[i - 1])
			a[i] = 200, ans += 1;
	printf("%d\n", ans);
} 