#include <bits/stdc++.h>
using namespace std;
int n, ans;
string x, pre;
int main() {
  scanf("%d", &n);
  while (n--) {
    cin >> x;
    if (x != pre) {
      ans++;
    }
    pre = x;
  }
  printf("%d\n", ans);
  return 0;
}
