#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a = 0, b = 0;
  string s;
  for (int i = 0; i < n; ++i) {
    cin >> s >> s;
    if (s == "soft")
      a++;
    else
      b++;
  }
  if (a < b) {
    int c = a;
    a = b;
    b = c;
  }
  for (int i = 0; i < 1000; ++i) {
    int x = ((i * i) + 1) / 2, y = (i * i) / 2;
    if (a <= x && b <= y) {
      cout << i;
      break;
    }
  }
}
