#include <bits/stdc++.h>
using namespace std;
int n, m, len, j, d, t;
string s;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s >> s;
    if (s[s.size() - 1] == 'd') d++;
  }
  m = max(d, n - d);
  while ((j * j + 1) / 2 < m || j * j < n) j++;
  cout << j;
}
