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