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