#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  char prev = s[1];
  int groups = n;
  for (int i = 1; i < n; i++) {
    cin >> s;
    if (s[0] != prev) groups--;
    prev = s[1];
  }
  cout << groups;
}
