#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<string, string>> v(n);
  int w = 0;
  int b = 0;
  for (auto &x : v) {
    cin >> x.first;
    cin >> x.second;
    if (x.second == "hard")
      w++;
    else
      b++;
  }
  int mina = sqrt(2 * b);
  int minb = sqrt(2 * w);
  int ans = max(mina, minb);
  if (ans * ans >= b + w) {
    if ((ans * ans) / 2 >= b && (ans * ans) / 2 >= w)
      cout << ans;
    else if (ans % 2 == 1) {
      if (b % 2 == 1 && (ans * ans) / 2 >= b - 1 && (ans * ans) / 2 >= w)
        cout << ans;
      else if (w % 2 == 1 && (ans * ans) / 2 >= w - 1 && (ans * ans) / 2 >= b)
        cout << ans;
      else
        cout << ++ans;
    } else
      cout << ++ans;
  } else
    cout << ++ans;
  return 0;
}
