#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, a1 = 0, x = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a1 != a) {
      a1 = a;
      x++;
    }
  }
  cout << x;
}
