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