#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const int inf = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
int n;
long long a[5010], ans;
char c[5010];
int main() {
  int i, j, k;
  a[1] = 1;
  k = 1;
  cin >> n;
  for (i = 1; i <= n; i++) {
    c[i] = getchar();
    c[i] = getchar();
    if (i > 1 & c[i - 1] == 'f') {
      for (j = k; j >= 1; j--) a[j + 1] = a[j];
      a[1] = 0;
      k++;
    }
    if (i > 2 && c[i - 1] == 's') {
      for (j = k; j >= 1; j--) a[j] = (a[j] + a[j + 1]) % mod;
    }
  }
  for (i = 1; i <= k; i++) ans = (ans + a[i]) % mod;
  cout << ans << "\n";
  return 0;
}
