#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
int32_t main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int Q = a[0];
  int ans = 1;
  for (int i = 1; i < n; i++) {
    if (a[i] != Q) {
      ans++;
      Q = a[i];
    }
  }
  printf("%d", ans);
  return 0;
}
