#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 5010;
long long n, dp[MAXN][MAXN], ans;
char a[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (a[n - 1] == 'f') {
    cout << 0;
    return 0;
  }
  dp[0][0] = 1;
  for (int i = 1; i < n; i++) {
    if (a[i - 1] == 'f') {
      for (int j = 0; j < MAXN - 1; j++) dp[i][j + 1] = dp[i - 1][j];
    } else {
      long long sum = 0;
      for (int j = MAXN - 1; j >= 0; j--) {
        sum = (sum + dp[i - 1][j]) % 1000000007;
        dp[i][j] = sum;
      }
    }
  }
  for (int i = 0; i < MAXN; i++) {
    ans = (ans + dp[n - 1][i]) % 1000000007;
  }
  cout << ans;
  return 0;
}
