#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
signed main() {
  int n;
  cin >> n;
  int ans = 1;
  string s;
  cin >> s;
  char ls = s[1];
  while (--n) {
    cin >> s;
    if (s[0] == ls) ans++;
    ls = s[1];
  }
  cout << ans << endl;
}
