#include <bits/stdc++.h>
int main() {
  long i, n, count = 0;
  scanf("%ld", &n);
  int a[n];
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  for (i = 0; i < n - 1; i++) {
    if (a[i] == 10 && a[i + 1] == 01 || a[i] == 01 && a[i + 1] == 10) count++;
  }
  printf("%ld\n", count + 1);
  return 0;
}
