#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int gr = 1;
  string lst, now;
  for (int i = 0; i < n; ++i) {
    cin >> now;
    if (i) {
      gr += lst != now;
    }
    lst = now;
  }
  cout << gr << '\n';
}
