#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
	int n,a[101],count=0;
	cin >> n;
	for(int i=0; i<n; i++) cin >> a[i];
	for(int i=0; i<n; i++){
		if(a[i] == a[i+1]){
			count++;
			a[i+1] = -1;
		}
	}
	cout << count << endl;
	return 0;
}