#include<iostream>
#include<algorithm>
#include<cstdlib>
using namespace std;
const int maxn = 10005;
int a[maxn]={0};
int main()
{
	int n;
	cin>>n;
	int ans=0;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<=n;i++)
	{
		if(a[i]==a[i-1]) a[i]+=rand()%100,ans++;
	}
	cout<<ans;
}