#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int dp[5010][5010];
int main() {
  int n;
  string str;
  cin >> n;
  str.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> str[i];
  }
  dp[0][0] = 1;
  for (int i = 1; i < n; i++) {
    if (str[i - 1] == 'f') {
      for (int j = 1; j < n; j++) dp[i][j] = dp[i - 1][j - 1];
    } else {
      int sum = 0;
      for (int j = n - 1; j >= 0; j--) {
        sum = (sum + dp[i - 1][j]) % mod;
        dp[i][j] = sum;
      }
    }
  }
  int ans = 0;
  for (int j = 0; j < n; j++) ans = (ans + dp[n - 1][j]) % mod;
  cout << ans << "\n";
  return 0;
}
