#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, g = 0, p = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string a, b;
    cin >> a >> b;
    if (b == "soft")
      g++;
    else
      p++;
  }
  for (int i = 1; i <= 100; i++) {
    if (g <= (i * i + 1) / 2 and p <= (i * i) / 2) {
      cout << i << endl;
      return 0;
    }
    if (g <= (i * i) / 2 and p <= (i * i + 1) / 2) {
      cout << i << endl;
      return 0;
    }
  }
}
