#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s[n];
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (i != 0) {
      if (s[i] != s[i - 1]) cnt++;
    }
  }
  cnt++;
  cout << cnt << endl;
  return 0;
}
