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