#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 1;
  string s1 = "", s2;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s2;
    s1 += s2;
  }
  for (int i = 2; i < n * 2; i += 2)
    if (!(s1[i] == s1[i - 2])) ++sum;
  cout << sum;
  return 0;
}
