#include <iostream>
using namespace std;
int main()
{
int n, i, precedent, urmator, secventeEgale=1;
cin >> n;
cin >> precedent;
for (i=2; i<=n; ++i)
{
cin >> urmator;
if (urmator!=precedent) ++secventeEgale;
precedent=urmator;
}
cout << secventeEgale;
return 0;
}