#include <iostream>
using namespace std;
const int N = 1010;
int a[N];
int main()
{
int n;
cin >> n;
for(int i = 1; i <= n; i++) cin >> a[i];
int res = 0;
for(int i = 1; i <= n; i++)
{
if(a[i] != a[i - 1]) res ++;
}
cout << res;
return 0;
}