#include<bits/stdc++.h>


using namespace std;
int total=0,n,a[105];

void cheak(int i,int p)
{
    //cout<<total<<" "<<i<<endl;
    if(i==n)
        return;
    if(p==a[i])
    {
        total+=1;
        p=0;
    }
    else
    {
        p=a[i];
    }
    cheak(i+1,p);
}

int main()
{
    int i,j;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a[i];

    }
    cheak(0,0);
    cout<<total<<endl;
}
