#include <bits/stdc++.h>
int main() {
  char x[100005], y[100005];
  int c = 1, n;
  scanf("%d", &n);
  scanf("%*c%c%c", &x[0], &y[0]);
  for (int i = 1; i < n; i++) {
    scanf("%*c%c%c", &x[i], &y[i]);
    if (x[i] == y[i - 1]) c++;
  }
  printf("%d\n", c);
}
