#include <bits/stdc++.h>
using namespace std;
long long dp[5003];
const long long mod = 1e9 + 7;
int main() {
  int n;
  int now = 1;
  dp[1] = 1;
  scanf("%d", &n);
  getchar();
  while (n--) {
    char c;
    scanf("%c", &c);
    getchar();
    if (c == 'f')
      now++;
    else {
      for (int i = 1; i <= now; i++) dp[i] = (dp[i] + dp[i - 1]) % mod;
    }
  }
  printf("%lld\n", dp[now]);
}
