#include<cstdio>
#include<cstring>
using namespace std;
#define N 100
int n;
int a[N+5];
int main()
{
	int num=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)
	if(a[i]==a[i+1]) num++,a[i+1]=-1;
	printf("%d",num);
 } 