#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int MAXN = 5010;
char s[20];
int n, sum[MAXN], a[MAXN];
long long dp[MAXN][MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s);
    a[i] = (s[0] == 'f' ? 1 : 0);
  }
  int cur = 0;
  for (int i = 1; i <= n; ++i) sum[i] = sum[i - 1] + a[i];
  dp[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    long long cur = 0;
    if (a[i] == 1) {
      for (int j = 0; j <= sum[i - 1]; ++j) dp[i][j] = dp[i - 1][j];
    } else
      for (int j = 0; j <= sum[i]; ++j) {
        cur = (cur + dp[i - 1][j]) % mod;
        dp[i][j] = cur;
      }
  }
  printf("%I64d\n", dp[n][sum[n]]);
}
