#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int last;
  cin >> last;
  int group = 1;
  for (int i = 0; i < t - 1; i++) {
    int now;
    cin >> now;
    if (now != last) {
      group++;
      last = now;
    }
  }
  cout << group << endl;
  return 0;
}
