#include <bits/stdc++.h>
using namespace std;
const int MAX = 5007;
const int mod = 1e9 + 7;
char s[MAX];
long long dp[MAX][MAX];
void solve() {
  int n;
  cin >> n;
  string s = "";
  s += 's';
  for (int i = 0; i < n; i++) {
    char x;
    cin >> x;
    s += x;
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    long long suff = 0;
    for (int j = n; j >= 0; j--) {
      suff += dp[i - 1][j];
      if (suff >= mod) suff -= mod;
      if (s[i - 1] == 'f') {
        if (j > 0) {
          dp[i][j] += dp[i - 1][j - 1];
        }
        if (dp[i][j] >= mod) dp[i][j] -= mod;
      } else {
        dp[i][j] = suff;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i <= n; i++) {
    ans += dp[n][i];
    if (ans >= mod) ans -= mod;
  }
  cout << ans << endl;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
