#include<bits/stdc++.h>
using namespace std;
int a[105];
int n;
int cnt;
int ans;
int main(){
	cin>>n;
	cnt=0;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		if(a[i]==a[i-1])cnt++;else ans+=cnt/2,cnt=1;
	}
	cout<<ans+cnt/2<<endl;
}