#include <iostream>
#include <cstdio>
using namespace std;

int n,s, a[105];
int main()
{
	int i;
	cin >> n;
	for (i = 1; i <= n; i++) {
		scanf ("%d", &a[i]);
	}
	for (i = 2; i <= n; i++){
		if (a[i] == a[i - 1]) {
			s++;
			i++;
		}
	}
	cout << s;
    return 0;
}
