#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]);
		if(a[i]==a[i-1]) 
		{
			ans++;
			a[i]=0;
		}
	}
	printf("%d\n",ans);
}