#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s = 0, h = 0;
  for (int i = (0); i < (n); ++i) {
    string u, t;
    cin >> u >> t;
    if (t == "soft")
      s++;
    else
      h++;
  }
  int ans = 1;
  do {
    int a = ans * ans / 2, b = ans * ans - a;
    if (max(a, b) >= max(s, h) && min(a, b) >= min(s, h)) {
      cout << ans << endl;
      return 0;
    }
  } while (ans++);
}
