#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n, mag = -1, pre_mag;
  int ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    pre_mag = mag;
    cin >> mag;
    if (mag != pre_mag) {
      ans++;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
