#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
int main() {
  int n;
  cin >> n;
  int ans = 1;
  string prev;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (i == 0) {
      prev = s;
      continue;
    }
    if (s != prev) {
      ++ans;
      prev = s;
    }
  }
  cout << ans << endl;
}
