#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string a[105], b[105];
  cin >> n;
  int c = 0, d = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    if (b[i] == "soft")
      c++;
    else
      d++;
  }
  int maxn = max(c, d);
  for (int i = 0; i < 1000; i++) {
    if ((i * i + 1) / 2 >= maxn && i * i >= c + d) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}
