#include <bits/stdc++.h>
using namespace std;
int dep[5005];
int ss[5005][5005];
const int MMD = 1e9 + 7;
int main() {
  int n;
  char ch;
  char lch;
  scanf("%d\n", &n);
  n--;
  int i = 1;
  scanf("%c\n", &ch);
  dep[0] = 0;
  ss[0][0] = 1;
  int sum;
  while (i <= n) {
    lch = ch;
    if (i < n)
      scanf("%c\n", &ch);
    else {
      scanf("%c", &ch);
      if (ch == 'f') {
        cout << 0;
        return 0;
      }
    }
    if (lch == 'f') {
      dep[i] = dep[i - 1] + 1;
      for (int j = dep[i]; j > 0; j--) ss[i][j] = ss[i - 1][j - 1];
      i++;
      continue;
    }
    dep[i] = dep[i - 1];
    sum = ss[i - 1][dep[i - 1] + 1];
    for (int j = dep[i - 1]; j >= 0; j--) {
      sum += ss[i - 1][j];
      if (sum >= MMD) sum %= MMD;
      ss[i][j] = sum;
    }
    i++;
  }
  sum = 0;
  for (int i = dep[n]; i >= 0; i--) {
    sum += ss[n][i];
    if (sum >= MMD) sum %= MMD;
  }
  cout << sum << endl;
  return 0;
}
