#include <bits/stdc++.h>
using namespace std;
int I_am_Sergey_Dyakonov;
int main() {
  int sum = 0;
  int n;
  cin >> n;
  string s = "";
  for (int r = 0; r < n; r++) {
    string y;
    cin >> y;
    s += y;
  }
  for (int r = 1; r < 2 * n; r++) {
    if (s[r] == s[r - 1]) {
      sum++;
    }
  }
  cout << (sum + 1);
}
