#include <bits/stdc++.h>
long long dp[5010][5010];
static long long go(const std::vector<char>& code, const long long& k,
                    const long long& for_count, const bool& no_statement) {
  if (k >= code.size()) {
    return 1;
  }
  if (!no_statement && dp[for_count][k] != -1) {
    return dp[for_count][k];
  }
  long long ret =
      go(code, k + 1, for_count + static_cast<long long>(code[k] == 'f'),
         code[k] == 'f');
  if (for_count && !no_statement) {
    ret += go(code, k, for_count - 1, false);
  }
  if (!no_statement)
    return dp[for_count][k] = ret % 1000000007;
  else
    return ret % 1000000007;
}
int main(void) {
  for (int j = 0; j < 5010; ++j) {
    for (int k = 0; k < 5010; ++k) dp[k][j] = -1;
  }
  long long n;
  std::scanf("%lld", &n);
  std::vector<char> code(n);
  for (auto& e : code) std::scanf(" %c", &e);
  std::printf("%lld\n", go(code, 0, 0, true) % 1000000007);
  return 0;
}
