#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
int a[105],n,cnt=0;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i){
		scanf("%d",&a[i]);
		if(a[i]==a[i-1])a[i]=inf,++cnt;
	}
	cout<<cnt;
	return 0;
}