#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int n,a[102],res;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        if(a[i]==a[i-1])
            res++,a[i]=0;
    }
    cout<<res;
}
