#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
enum { MOD0 = 1000000000, MOD7 = 1000000007, MOD9 = 1000000009 };
template <typename T>
ostream &operator<<(ostream &cout, vector<T> &a) {
  for (size_t i = 0; i < a.size(); ++i) cout << a[i] << " ";
  return cout;
}
template <typename T>
ostream &operator<<(ostream &cout, vector<vector<T> > &a) {
  for (size_t i = 0; i < a.size(); ++i) cout << a[i] << endl;
  return cout;
}
int main() {
  int n;
  cin >> n;
  string a, b;
  int wh = 0, bl = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a >> b;
    if (b == "soft") {
      wh++;
    } else {
      bl++;
    }
  }
  if (wh > bl) {
    swap(wh, bl);
  }
  for (int x = 1; true; ++x) {
    int ans = (x * x + 1) / 2;
    if (ans >= bl && (x * x) / 2 >= wh) {
      cout << x << '\n';
      break;
    }
  }
  return 0;
}
