#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
char a[5000];
int dp[5000][5000];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) cin >> a[i];
  dp[0][0] = 1;
  for (int i = 1; i < n; i++) dp[0][i] = 0;
  for (int i = 1; i < n; i++) {
    if (a[i - 1] == 'f') {
      dp[i][0] = 0;
      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 > -1; j--) {
        sum = (sum + dp[i - 1][j]) % MOD;
        dp[i][j] = sum;
      }
    }
  }
  int res = 0;
  for (int i = 0; i < n; i++) res = (res + dp[n - 1][i]) % MOD;
  printf("%d", res);
}
