#include <bits/stdc++.h>
using namespace std;
using namespace placeholders;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VS = vector<string>;
using SS = stringstream;
using PII = pair<int, int>;
using VPII = vector<pair<int, int> >;
template <typename T = int>
using VT = vector<T>;
template <typename T = int>
using VVT = VT<VT<T> >;
template <typename T = int>
using LIM = numeric_limits<T>;
template <typename T>
inline T fromString(const string &s) {
  T res;
  istringstream iss(s);
  iss >> res;
  return res;
};
template <typename T>
inline string toString(const T &a) {
  ostringstream oss;
  oss << a;
  return oss.str();
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  for (int n; cin >> n, n;) {
    VS moves(n);
    for (auto &m : moves) {
      cin >> m;
    }
    int state = 0;
    VI states(1, 0);
    for (auto &m : moves) {
      const int p = m[0] == 'l' ? 1 : 0;
      state ^= 1 << p;
      states.push_back(state);
    }
    states.erase(
        remove_if((states).begin(), (states).end(),
                  [](const int a) { return __builtin_popcount(a) == 1; }),
        states.end());
    states.erase(unique((states).begin(), (states).end()), states.end());
    cout << states.size() - 1 << endl;
  }
  return 0;
}
