#include <bits/stdc++.h>
using namespace std;
template <typename T>
auto operator<<(ostream& out, T& container)
    -> decltype(container.begin(), container.end(), out) {
  bool first = true;
  out << "[";
  for (auto it = container.begin(); it != container.end(); ++it) {
    if (!first) out << ", ";
    out << *it;
    first = false;
  }
  return out << "]";
}
int n;
int a = 0, b = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string x, y;
    cin >> x >> y;
    if (y == "hard")
      a++;
    else
      b++;
  }
  if (a < b) swap(a, b);
  for (int x = 1;; ++x) {
    int ya, yb;
    yb = (x * x) / 2;
    ya = (x * x) - yb;
    if (a <= ya && b <= yb) {
      cout << x << "\n";
      return 0;
    }
  }
}
