#include <bits/stdc++.h>
using namespace std;
int main() {
  int x[100000], y, count = 1;
  cin >> y;
  for (int i = 0; i < y; i++) cin >> x[i];
  for (int i = 0; i < y - 1; i++) {
    if (x[i] != x[i + 1]) count++;
  }
  cout << count << endl;
  return 0;
}
