#include <bits/stdc++.h>
using namespace std;
const long long INF = 4e18;
const int N = 5e3 + 1;
const long long mod = 1e9 + 7;
const long double eps = 1E-7;
int ans;
int n, s;
char a[N];
int d[N][N];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  d[1][1] = 1;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 2; i <= n; i++) {
    s = 0;
    for (int j = n; j >= 1; j--) {
      s = (s + d[i - 1][j]) % mod;
      if (a[i - 1] == 's')
        d[i][j] = s;
      else
        d[i][j] = d[i - 1][j - 1];
    }
  }
  for (int i = 1; i <= n; i++) ans = (ans + d[n][i]) % mod;
  cout << ans << endl;
}
