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