#include <bits/stdc++.h>
using namespace std;
int n, s1, s2, ans, s3, s4;
string str1, str2;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    cin >> str1 >> str2;
    if (str2 == "soft")
      s1++;
    else
      s2++;
  }
  s3 = min(s1, s2);
  s4 = max(s1, s2);
  while (true) {
    int cnt1 = 0, cnt2 = 0;
    ans++;
    cnt1 = (ans * ans + 1) / 2;
    cnt2 = ans * ans - cnt1;
    if (s4 <= cnt1 && s3 <= cnt2) break;
  }
  printf("%d\n", ans);
  return 0;
}
