#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  char a[10], xxx[20];
  cin >> n;
  long x1 = 0, x2 = 0;
  for (long i = 0; i < n; ++i) {
    scanf("%s%s", xxx, a);
    if (a[0] == 's')
      ++x1;
    else
      ++x2;
  }
  if (x1 > x2) {
    long c = x1;
    x1 = x2;
    x2 = c;
  }
  long s = 0;
  while (s * s / 2 < x1 || (s * s + 1) / 2 < x2) ++s;
  cout << s << endl;
  return 0;
}
