#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000000 + 7;
const int maxn = 5000 + 100;
int n;
int dp[maxn];
int sum[maxn];
char str[maxn];
int main() {
  ios::sync_with_stdio(false);
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; ++i) {
      scanf("%s", str + i);
    }
    memset(dp, 0, sizeof(dp));
    memset(sum, 0, sizeof(sum));
    dp[0] = sum[0] = 1;
    for (int i = 1; i < n; ++i) {
      for (int j = maxn - 10; j >= 0; --j) {
        if (str[i - 1] == 's') {
          dp[j] = sum[j];
        } else {
          dp[j] = dp[j - 1];
        }
        sum[j] = dp[j] + sum[j + 1];
        dp[j] %= MOD;
        sum[j] %= MOD;
      }
    }
    int ans = 0;
    for (int i = 0; i < maxn; ++i) {
      ans += dp[i];
      ans %= MOD;
    }
    printf("%d\n", ans);
  }
  return 0;
}
