#include <bits/stdc++.h>
int main() {
  int a, b, count = 1, n, i;
  scanf("%d %d", &n, &a);
  for (i = 1; i < n; i++) {
    scanf("%d", &b);
    if (a != b) {
      count++;
    }
    a = b;
  }
  printf("%d", count);
}
