#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  string s1, s2;
  int cnt = 0;
  cin >> x >> ws;
  for (int i = x; i; i--) {
    cin >> s1;
    cin >> s2;
    if (s2.compare("soft") == 0) cnt++;
  }
  if (x - cnt > cnt) cnt = x - cnt;
  for (int i = 0; i < 100; ++i) {
    if (i * i / 2 + i % 2 >= cnt && i * i >= x) {
      cout << i << endl;
      return 0;
    }
  }
  return 0;
}
