#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int main() {
  int n, c1 = 0, c2 = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> s1 >> s2;
    if (s2 == "soft")
      c2++;
    else
      c1++;
  }
  cout << ceil(sqrt(max(max(c1, c2) * 2 - 1, c1 + c2))) << endl;
  return 0;
}
