#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a;
  string b = "e";
  int g = 1;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (b == "e") b = a;
    if (a != b) g++;
    b = a;
  }
  cout << g << endl;
}
