#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int dp[5005][5005];
int sum[5005][5005];
int tot[5005];
char q[5005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> q[i];
  dp[1][1] = 1;
  sum[1][1] = 1;
  tot[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (q[i - 1] == 'f') {
      for (int j = 2; j <= i; j++) dp[i][j] = dp[i - 1][j - 1];
    } else {
      for (int j = 1; j <= i; j++)
        dp[i][j] = (tot[i - 1] + mod - sum[i - 1][j - 1]) % mod;
    }
    for (int j = 1; j <= i; j++) sum[i][j] = (sum[i][j - 1] + dp[i][j]) % mod;
    tot[i] = sum[i][i];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans = (ans + dp[n][i]) % mod;
  cout << ans << endl;
  return 0;
}
