#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int N;
  cin >> N;
  int soft = 0;
  int hard = 0;
  while (N--) {
    cin >> s;
    cin >> s;
    if (s == "soft")
      soft++;
    else
      hard++;
  }
  if (hard > soft) swap(soft, hard);
  int i = 0;
  while (((i * i) / 2) < hard) i++;
  while (((i * i + 1) / 2) < soft) i++;
  printf("%d\n", i);
  return 0;
}
