#include <bits/stdc++.h>
using namespace std;
int n, a, b;
string s, g;
map<string, pair<int, int> > m;
int main() {
  m["goat"] = make_pair(1, 1);
  m["asiago"] = make_pair(1, 2);
  m["camembert"] = make_pair(1, 3);
  m["gouda"] = make_pair(2, 1);
  m["feta"] = make_pair(2, 2);
  m["swiss"] = make_pair(2, 3);
  m["muenster"] = make_pair(3, 1);
  m["cheddar"] = make_pair(3, 2);
  m["brie"] = make_pair(3, 3);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> s >> g;
    if (g == "soft") {
      a++;
    } else {
      b++;
    }
  }
  int res = 1;
  while ((res * res) / 2 + (res * res) % 2 < max(a, b) || res * res < a + b) {
    res++;
  }
  cout << res << "\n";
  return 0;
}
