#include <bits/stdc++.h>
int main() {
  int i = 0, x = 0, s = 0, cont = 0, c = 0;
  scanf("%d", &s);
  while (i < s) {
    scanf("%d", &c);
    if (x != c) {
      cont++;
      x = c;
    }
    i++;
  }
  printf("%d", cont);
  return 0;
}
