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