#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a, b;
  int aa = 0, bb = 0;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    if (b == "soft")
      aa++;
    else
      bb++;
  }
  int ma = max(aa, bb);
  for (int i = 0;; i++) {
    int tmp = (i * i) % 2 ? i * i / 2 + 1 : i * i / 2;
    if (tmp >= ma && aa + bb <= i * i) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}
