#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-10;
static const double PI = acos(-1.0);
static const int mod = 10007;
static const int INF = 1 << 25;
static const long long LL_INF = 1152921504606846976;
static const int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
static const int dy[] = {0, 0, 1, -1, 1, 1, -1, -1};
int n;
string str;
pair<int, int> many_push;
int ans;
pair<bool, bool> now;
int gcd(int m, int n) {
  if (n == 0) return m;
  return gcd(n, m % n);
}
int main() {
  now = make_pair(false, false);
  while (~scanf("%d", &n) && n) {
    ans = 0;
    for (int i = 0; i < n; i++) {
      cin >> str;
      if (str == "lu") {
        now.first = true;
        ans += now.second && !(ans % 2);
        continue;
      }
      if (str == "ru") {
        now.second = true;
        ans += now.first && !(ans % 2);
        continue;
      }
      if (str == "ld") {
        now.first = false;
        ans += !now.second && ans % 2;
        continue;
      }
      if (str == "rd") {
        now.second = false;
        ans += !now.first && ans % 2;
        continue;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
