#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int N = 5010;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  char pr = ' ';
  long long dp[N] = {};
  dp[0] = 1;
  bool first = true;
  for (int k = 0; k < n; k++) {
    char c;
    cin >> c;
    if (pr == 'f') {
      for (int k = N - 1; k >= 1; k--) {
        dp[k] = dp[k - 1];
      }
      dp[0] = 0;
    }
    if (pr == 's') {
      for (int k = N - 2; k >= 0; k--) {
        dp[k] = (dp[k] + dp[k + 1]) % MOD;
      }
    }
    pr = c;
    if (pr == 'f') {
      first = false;
    }
  }
  long long sum = 0;
  for (int k = 0; k < N; k++) {
    sum = (sum + dp[k]) % MOD;
  }
  cout << sum;
  return 0;
}
