#include <bits/stdc++.h>
using namespace std;
string s;
int n, i, nr1, nr2, nra, nrb, a[1001][1001], siz, j;
int main() {
  cin >> n;
  for (i = 1; i <= n; ++i) {
    cin >> s;
    cin >> s;
    if (s == "soft")
      nr1++;
    else if (s == "hard")
      nr2++;
  }
  while (1) {
    for (siz = 1;; ++siz) {
      nra = nrb = 0;
      n = siz;
      memset(a, 0, sizeof(a));
      for (i = 1; i <= n; ++i) a[i][0] = i % 2;
      for (i = 1; i <= n; ++i)
        for (j = 1; j <= n; ++j) {
          if (a[i][j - 1] == 0)
            a[i][j] = 1;
          else
            a[i][j] = 0;
        }
      for (i = 1; i <= n; ++i) {
        for (j = 1; j <= n; ++j)
          if (a[i][j] == 1)
            nra++;
          else
            nrb++;
      }
      if ((nra >= nr1 && nrb >= nr2) || nra >= nr2 && nrb >= nr1) {
        cout << siz;
        return 0;
      }
    }
  }
  return 0;
}
