#include<iostream>

int main(){
	int N;
	std::cin >> N;
	
	int a[110] = {0};
	for (int i=1;i<=N;i++) {
		std::cin >> a[i];
	}
	
	int ans=0;
	for (int i=2;i<=N;i++) {
		if (a[i-1]==a[i]) {
			a[i] = a[i+1]+1;
			ans++;
		}
	}
	
	std::cout << ans << '\n';
}