#include <bits/stdc++.h>
using namespace std;
int main() {
  int p[100000], n, sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i];
  for (int i = 0; i < n; i++) {
    if (p[i] != p[i + 1]) sum++;
  }
  cout << sum << endl;
}
