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