#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string name, type;
  cin >> n;
  int s = 0, h = 0;
  for (int i = 0; i < n; i++) {
    cin >> name >> type;
    if (type == "soft") {
      s++;
    } else {
      h++;
    }
  }
  int m = max(s, h);
  int size = sqrt(2 * m);
  int lower = size * size;
  int big_half = ceil(1. * lower / 2);
  if (big_half >= m && lower - big_half >= min(s, h)) {
    cout << size << endl;
  } else {
    cout << size + 1 << endl;
  }
}
