#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, nums = 0, numh = 0;
  string str, st;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> str >> st;
    if (st == "soft")
      nums++;
    else
      numh++;
  }
  for (int i = 1; i <= 100; i++) {
    if (i * i + 1 < 2 * nums) continue;
    if (i * i + 1 < 2 * numh) continue;
    if (i * i < nums + numh) continue;
    cout << i << endl;
    break;
  }
  return 0;
}
