#include <bits/stdc++.h>
using namespace std;
int n, total;
void solve() {
  char tmp1, tmp2, pre;
  scanf("%d\n", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%c%c\n", &tmp1, &tmp2);
    if (tmp1 == pre || i == 1) total++;
    pre = tmp2;
  }
  printf("%d\n", total);
}
int main() {
  solve();
  return 0;
}
