#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d\n", &N);
  char nm[105], s[105];
  int soft = 0;
  int hard = 0;
  int i;
  for (i = 0; i < N; i++) {
    scanf("%s %s\n", nm, s);
    if (!strncmp(s, "soft", 4)) {
      soft++;
    } else {
      hard++;
    }
  }
  N = 1;
  while (true) {
    int SOFT = (N * N + 1) / 2;
    int HARD = (N * N) / 2;
    if ((soft <= SOFT) && (hard <= HARD)) {
      printf("%d\n", N);
      return 0;
    }
    if ((soft <= HARD) && (hard <= SOFT)) {
      printf("%d\n", N);
      return 0;
    }
    N++;
  }
  return 0;
}
