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