#include<cmath>
#include<cstring>
#include<iostream>
using namespace std;
int main(){
	long i,n,a[10005],b[10005],maxn=-213,sum=0;
	cin>>n;
	for(i=0;i<10005;i++){
		b[i]=1;
	}
	cin>>a[0];
	for(i=1;i<n;i++){
		cin>>a[i];
		maxn=max(maxn,a[i]);
		if(a[i]==a[i-1]){
			b[a[i]]++;
		}
	}
	for(i=1;i<=maxn;i++){
		if(b[i]>1){
			sum+=b[i]/2;
		}
	}
	cout<<sum;
}