#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, group = 0;
  cin >> n;
  int a[n];
  if (n == 1) {
    cin >> a[0];
    cout << 1;
  } else if (n > 1 && n <= 100000) {
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
      if (a[i] != a[i + 1]) {
        group++;
      }
    }
    cout << group;
  }
}
