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