#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e3 + 42;
int n, m;
vector<int> dp;
const int mod = 1e9 + 7;
int main() {
  cin >> n;
  dp.resize(MAXN);
  dp[1] = 1;
  int maxi = 1;
  char prv = 's';
  for (int i = 0; i < n; ++i) {
    char c;
    cin >> c;
    if (c == 'f') ++maxi;
    vector<int> newdp(maxi + 4);
    if (prv == 'f') {
      for (int j = maxi + 2; j >= 1; --j) {
        newdp[j] = dp[j - 1];
      }
      swap(dp, newdp);
      prv = c;
      continue;
    }
    int tsum = 0;
    for (int j = maxi + 2; j >= 1; --j) {
      tsum += dp[j];
      tsum %= mod;
      newdp[j] += tsum;
      newdp[j] %= mod;
      if (c == 's') {
      } else {
      }
      newdp[j] %= mod;
    }
    swap(newdp, dp);
    prv = c;
  }
  int sum = 0;
  for (int i = 0; i < dp.size(); ++i) {
    sum += dp[i];
    sum %= mod;
  }
  cout << sum;
}
