#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 2, b = 0, n;
  string s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s[0] != a) {
      b++;
      a = s[0];
    } else
      a = s[0];
  }
  cout << b;
}
