#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = double;
using pll = pair<ll, ll>;
using vll = vector<ll>;
using vpll = vector<pll>;
using vvll = vector<vll>;
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  int n;
  cin >> n;
  int s = 0, h = 0;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  int curSide = 2;
  for (ll i = 0; i < (ll)n; ++i) {
    string cheese;
    cin >> cheese;
    string soft;
    cin >> soft;
    if (soft == "soft")
      s++;
    else
      h++;
    while (s > (curSide * curSide) / 2 && h > (curSide * curSide) / 2)
      curSide++;
    while (s + h > curSide * curSide) curSide++;
    while (s > (curSide * curSide + 1) / 2) curSide++;
    while (h > (curSide * curSide + 1) / 2) curSide++;
  }
  cout << curSide << endl;
  return 0;
}
