#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long n;
  cin >> n;
  long c = 0;
  vector<string> v;
  for (long i = 0; i < n; i++) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  for (long i = 0; i + 1 < n; i++) {
    if (v[i] != v[i + 1]) c++;
  }
  cout << c + 1 << endl;
  return 0;
}
