#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
int a[N];
int main()
{
ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
cin >> n;
int x = -1;
int ans = 0;
for(int i = 0 ; i < n ; i++)
{
cin >> a[i];
if(x == -1)
x = a[i];
else if (x != a[i])
{
ans++;
x = -1;
}
}
cout << ans << '\n';
}