#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<string> s1;
  for (long long j = 0; j < n; j++) {
    string s;
    cin >> s;
    s1.push_back(s);
  }
  long long ans = 0;
  string prev;
  for (long long j = 0; j < n; j++) {
    if (j == 0) {
      prev = s1[j];
    } else {
      if (s1[j][0] == prev[1]) {
        ans++;
        prev = s1[j];
      }
    }
  }
  cout << ans + 1 << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
