#include <bits/stdc++.h>
using namespace std;
int n, cnt1, cnt2, x, y;
string s1, s2;
int main() {
  cin >> n;
  cnt1 = cnt2 = 0;
  while (n--) {
    cin >> s1 >> s2;
    if (s2 == "soft")
      cnt1++;
    else
      cnt2++;
  }
  if (cnt1 < cnt2) swap(cnt1, cnt2);
  for (int i = 1; i <= 100; i++)
    if (i & 1) {
      x = i * i / 2 + 1;
      y = i * i / 2;
      if (x >= cnt1 && y >= cnt2) {
        printf("%d\n", i);
        return 0;
      }
    } else {
      x = i * i / 2;
      if (x >= cnt1 && x >= cnt2) {
        printf("%d\n", i);
        return 0;
      }
    }
  return 0;
}
