#include<iostream>
using namespace std;
int main(){
	int n, A[100];
	cin >> n;
	for (int i = 0; i < n; i++) cin >> A[i];
	int p = 0, ans = 0;
	while (p < n) {
		int c = A[p],f=0;
		while (p < n&&A[p] == c) f++, p++;
		ans += f / 2;
	}
	cout << ans;
}