#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, res = 1;
  string s = "";
  cin >> n;
  for (int i = 0; i < n; i++) {
    string x;
    cin >> x;
    s += x;
  }
  for (int i = 0; i < s.size(); i += 2) {
    if (s[i] == s[i - 1]) res++;
  }
  cout << res;
  return 0;
}
