#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  long long n;
  cin >> n;
  vector<string> v;
  for (long long i = 0; i < n; i++) {
    string a;
    cin >> a;
    v.push_back(a);
  }
  long long count = 1;
  for (long long i = 0; i < v.size() - 1; i++) {
    if (v[i] != v[i + 1]) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
