#include <bits/stdc++.h>
using namespace std;
string s;
int n, cnt;
bool l, r;
int main() {
  while (cin >> n && n) {
    cnt = 0;
    l = 0, r = 0;
    for (int i = 0; i < n; ++i) {
      cin >> s;
      if (s == "lu")
        l = 1;
      else if (s == "ru")
        r = 1;
      else if (s == "ld")
        l = 0;
      else if (s == "rd")
        r = 0;
      if (l && r)
        cnt++;
      else if (cnt % 2 == 1 && !l && !r)
        cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}
