#include <bits/stdc++.h>
int main() {
  int n, lr, ans;
  char buf[5];
  while (scanf("%d", &n) && n > 0) {
    ans = 0, lr = 0;
    while (n-- > 0) {
      scanf("%s", buf);
      if (*buf == 'l')
        lr |= 1;
      else if (*buf == 'r')
        lr |= 2;
      if (lr == 3) ans++, lr = 0;
    }
    printf("%d\n", ans);
  }
  return 0;
}
