#include <bits/stdc++.h>
using namespace std;
int klocki[200000];
int main() {
  int n;
  string s1, s2;
  cin >> n;
  int k = 1;
  int ans = 0;
  int h_i = 0;
  int s_i = 0;
  for (int i = 0; i < n; i++) {
    cin >> s1 >> s2;
    if (s2 == "hard")
      h_i++;
    else
      s_i++;
  }
  int ans1, ans2;
  if (h_i == 1 && s_i == 0) {
    cout << 1;
    return 0;
  }
  if (h_i == 0 && s_i == 1) {
    cout << 1;
    return 0;
  }
  int a, b;
  a = s_i;
  b = h_i;
  if (a > b) swap(a, b);
  for (int i = 1; i < 100; i++) {
    if (a <= i * i / 2 && b <= i * i / 2 + i % 2) {
      cout << i;
      break;
    }
  }
  return 0;
}
