#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int N = 5e3 + 5;
int t, dp[N], sum;
char c;
int main() {
  scanf("%d", &t);
  dp[0] = 1;
  while (t--) {
    scanf(" %c", &c);
    sum = 0;
    for (int i = N - 2; i >= 0; i--) {
      sum = (sum + dp[i]) % MOD;
      if (c == 's')
        dp[i] = sum;
      else
        dp[i + 1] = dp[i];
    }
    if (c == 'f') dp[0] = 0;
  }
  printf("%d\n", sum);
  return 0;
}
