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