#include <bits/stdc++.h>
using namespace std;
inline int init() {
  int now = 0, ju = 1;
  char c;
  bool flag = false;
  while (1) {
    c = getchar();
    if (c == '-')
      ju = -1;
    else if (c >= '0' && c <= '9') {
      now = now * 10 + c - '0';
      flag = true;
    } else if (flag)
      return now * ju;
  }
}
inline long long llinit() {
  long long now = 0, ju = 1;
  char c;
  bool flag = false;
  while (1) {
    c = getchar();
    if (c == '-')
      ju = -1;
    else if (c >= '0' && c <= '9') {
      now = now * 10 + c - '0';
      flag = true;
    } else if (flag)
      return now * ju;
  }
}
const int mod = 1e9 + 7;
int f[5005][5005];
int n;
char str[5005];
int main() {
  n = init();
  for (int i = 0; i < n; i++) scanf("%s", str + i);
  f[0][0] = 1;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum = 0;
    if (str[i] == 'f') {
      for (int j = 0; j <= i; j++) f[i + 1][j + 1] = f[i][j];
    } else if (str[i] == 's') {
      for (int j = i; j >= 0; j--) {
        sum += f[i][j];
        sum %= mod;
        f[i + 1][j] += sum;
      }
    }
  }
  sum = 0;
  for (int i = 0; i <= n; i++) {
    sum += f[n - 1][i];
    sum %= mod;
  }
  printf("%d\n", sum);
  return 0;
}
