#include<bits/stdc++.h>
using namespace std;
int read() {
	char ch=getchar();
	int x=0;
	while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	return x;
}
int n,ans,cnt,a[233];
int main() {
	n=read();
	for(int i=1;i<=n;i++) a[i]=read();
	for(int i=1;i<=n;i++) {
		if(a[i]==a[i-1]) cnt++;
		else{
			ans+=cnt/2;cnt=1;
		}
	}
	ans+=cnt/2;
	printf("%d\n",ans);
}