#include <bits/stdc++.h>
const int P = 1e9 + 7;
signed main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  int n;
  std::cin >> n;
  std::vector<char> a(n + 1);
  std::vector<int> dp(n + 2), ndp(n + 2);
  for (int i = 1; i <= n; i++) {
    std::cin >> a[i];
  }
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i - 1] == 'f') {
      for (int i = n; i >= 1; i--) ndp[i] = dp[i - 1];
    } else {
      for (int i = n; i >= 1; i--) {
        ndp[i] = ndp[i + 1] + dp[i];
        if (ndp[i] > P) ndp[i] -= P;
      }
    }
    for (int i = 1; i <= n; i++) dp[i] = ndp[i];
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += dp[i];
    if (ans > P) ans -= P;
  }
  std::cout << ans;
  return 0;
}
