#include <bits/stdc++.h>
int main(int argc, const char* argv[]) {
  int n;
  int bl = 0, w = 0;
  std::cin >> n;
  std::string str1 = "", str2 = "";
  for (int i = 0; i < n; i++) {
    std::cin >> str1 >> str2;
    if (str2 == "soft")
      w++;
    else
      bl++;
  }
  w = std::max(w, bl);
  for (int i = 0; i <= n; i++) {
    int c = ceil((double)i * (double)i / 2);
    if (w <= c && n <= i * i) {
      std::cout << i << '\n';
      break;
    }
  }
  return 0;
}
