#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  ll soft = 0;
  ll hard = 0;
  for (ll i = 0; i < n; i++) {
    string name, typ;
    cin >> name >> typ;
    if (typ == "soft") {
      soft++;
    }
    if (typ == "hard") {
      hard++;
    }
  }
  for (ll n = 1;; n++) {
    if ((n * n + 1) / 2 >= std::max(soft, hard) &&
        (n * n / 2) >= std::min(soft, hard)) {
      cout << n << endl;
      break;
    }
  }
}
