#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  int c = 0, n;
  cin >> n >> a;
  while (--n) {
    cin >> b;
    if (a != b) {
      c++;
      a = b;
    }
  }
  cout << c + 1;
}
