#include <bits/stdc++.h>
using namespace std;
int n, soft, hard;
string s;
bool check(int x) {
  x *= x;
  return ((x >> 1) >= soft && x - (x >> 1) >= hard);
}
int process() {
  int i = 1;
  while (true) {
    if (check(i)) return i;
    ++i;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n;
  while (n-- > 0) {
    cin >> s >> s;
    if (s.back() == 't')
      ++soft;
    else
      ++hard;
  }
  if (soft > hard) swap(soft, hard);
  cout << process();
}
