#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string x;
  int ans = 1;
  vector<string> a;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
  }
  for (int i = 0; i < n - 1; ++i) {
    if (a[i] != a[i + 1]) ans++;
  }
  cout << ans;
  return 0;
}
