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