#include <bits/stdc++.h>
int main() {
  int n, i, count = 0;
  scanf("%d", &n);
  char magnets[n][2];
  for (i = 0; i < n; i++) {
    scanf("%s", magnets[i]);
  }
  for (i = 0; i < n - 1; i++) {
    if (magnets[i][1] == magnets[i + 1][0]) count++;
  }
  printf("%d", count + 1);
  return 0;
}
