#include <bits/stdc++.h>
using namespace std;
int n, cnt0, cnt1;
string cheese, chtype;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> cheese >> chtype;
    if (chtype == "soft")
      cnt0++;
    else
      cnt1++;
  }
  if (cnt1 < cnt0) swap(cnt0, cnt1);
  for (int sz = 1; sz <= 100; sz++) {
    int black = (sz * sz) / 2;
    int white = (sz * sz) - black;
    if (white > black) swap(black, white);
    if (white >= cnt0 && black >= cnt1) {
      cout << sz;
      return 0;
    }
  }
  return 0;
}
