#include<bits/stdc++.h>


using namespace std;

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