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