#include<cstdio>
const int MAXN=105;

int n;
int a[MAXN];

int main()
{
	scanf("%d",&n);
	int cnt=0,ans=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",a+i);
		if(a[i]==a[i-1])
			cnt++;
		else
			ans+=cnt/2,cnt=1;
	}
	ans+=cnt/2;
	printf("%d\n",ans);
	
	return 0;
}
