#include<cstdio>
#define maxn 105
int n,a[maxn],ans;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	int cnt=0;
	for(int i=1;i<=n+1;i++)
		if(a[i]!=a[i-1])
		{
			ans+=cnt/2;
			cnt=1;
		}
		else cnt++;
	printf("%d\n",ans);
}