#include <bits/stdc++.h>
int main() {
  int n, x, count = 0, p = -1;
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &x);
    if (x != p) {
      count++;
      p = x;
    }
  }
  printf("%d\n", count);
  return 0;
}
