#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  string a, b;
  long long int N;
  cin >> N;
  long long int s = 0, h = 0;
  for (long long int i = (0); i < (long long int)(N); ++i) {
    cin >> a >> b;
    if (b == "soft")
      s++;
    else
      h++;
  }
  for (long long int i = (0); i < (long long int)(100); ++i) {
    long long int lh = i * i / 2;
    long long int ls = i * i / 2 + (i % 2);
    if (s <= ls && h <= lh || s <= lh && h <= ls) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}
