#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const* argv[]) {
  if (argc == 3) {
    freopen(argv[1], "r", stdin);
    freopen(argv[2], "w", stdout);
  }
  int timing = clock();
  int n;
  scanf("%d", &n);
  char list[n][3];
  for (int i = 0; i < n; i += 1) {
    scanf("%s", list[i]);
  }
  int answer = 1;
  for (int i = 1; i < n; i += 1) {
    if (list[i - 1][1] == list[i][0]) {
      ++answer;
    }
  }
  printf("%d\n", answer);
  assert((clock() - timing) * 1000 / CLOCKS_PER_SEC <= 3000);
  return 0;
}
