#include <bits/stdc++.h>
using namespace std;
void print(vector<int> &A) {
  for (int i = 0; i < A.size(); i++) cout << A[i] << " ";
  cout << endl;
}
int main() {
  int N;
  scanf("%d", &N);
  int hard = 0, soft = 0;
  for (int i = 0; i < N; i++) {
    string name, type;
    cin >> name;
    cin >> type;
    if (type == "hard")
      hard++;
    else if (type == "soft")
      soft++;
  }
  int curr = max(hard, soft);
  int cMin = min(hard, soft);
  int ans = 0;
  for (int i = 1; i < 100; i++) {
    int val = i * i;
    int cm = val / 2;
    if (val % 2 == 1) cm++;
    if (curr <= cm && curr + cMin <= val) {
      ans = i;
      break;
    }
  }
  printf("%d\n", ans);
  return 0;
}
