#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s = 0, h = 0;
  for (int i = 0; i < n; i++) {
    string s1, s2;
    cin >> s1 >> s2;
    if (s2 == "hard")
      h++;
    else
      s++;
  }
  int cnt = 0;
  while ((cnt * cnt / 2) < min(s, h) || (cnt * cnt + 1) / 2 < max(s, h)) cnt++;
  cout << cnt << endl;
  return 0;
}
