#include <bits/stdc++.h>
int main() {
  int n, input;
  int count = 1;
  int s = 3;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &input);
    if (input == 10) {
      if (s == 1) {
        count++;
      }
      s = 0;
    } else if (input == 1) {
      if (s == 0) {
        count++;
      }
      s = 1;
    }
  }
  printf("%d", count);
  return 0;
}
