#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int soft = 0;
  int hard = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    cin >> s;
    if (s[0] == 's')
      soft++;
    else
      hard++;
  }
  for (int i = 1; i < 1000; i++) {
    int tmp = (i * i) / 2;
    if (soft <= tmp && hard <= i * i - tmp) {
      cout << i;
      return 0;
    }
    if (soft <= i * i - tmp && hard <= tmp) {
      cout << i;
      return 0;
    }
  }
  return 0;
}
