#include<iostream>
using namespace std;
int main()
{
int n, x[100001], tmp, co = 0;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> x[i];
}
tmp = x[0];
for (int i = 0; i < n-1; i++)
{
if (tmp == x[i + 1])
continue;
co++;
if (i + 2 < n)
tmp = x[i + 2];
}
cout << co;
return 0;
}