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