#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("no-stack-protector,unroll-loops")
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-function"
using namespace std;
const int maxn = 5005;
const int md = (int)1e9 + 7;
string s[maxn];
int n;
int cache[maxn][maxn][2];
int calc(int pos, int open, int flag) {
  if (pos == n && open == 0) return 1;
  if (pos > n || open < 0) return 0;
  int ret = 0;
  if (~cache[pos][open][flag]) return cache[pos][open][flag];
  if (s[pos] == "s")
    ret = calc(pos + 1, open, 0);
  else
    ret = calc(pos + 1, open + 1, 1);
  if (!flag) ret = (ret + calc(pos, open - 1, 0)) % md;
  return cache[pos][open][flag] = ret;
}
void solve() {
  cin >> n;
  for (int i = 0; i < (int)(n); i++) cin >> s[i];
  memset(cache, -1, sizeof(cache));
  cout << calc(0, 0, 0) << "\n";
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  cout << fixed;
  clock_t clock_start = clock();
  solve();
  return 0;
}
