#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto& x : a) {
    cin >> x;
  }
  int res = 1;
  for (int i = 1; i < n; ++i) {
    res += a[i] != a[i - 1];
  }
  cout << res;
  return 0;
}
