#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int dp[5005][5005];
char str[5005][3];
int n;
int solve(int pos, int nested) {
  if (pos == n) return 1;
  if (dp[pos][nested] != -1) return dp[pos][nested];
  int &ans = dp[pos][nested];
  ans = 0;
  if (pos != 0 && str[pos - 1][0] != 'f' && nested > 0)
    ans += solve(pos, nested - 1);
  if (str[pos][0] == 'f')
    ans += solve(pos + 1, nested + 1);
  else
    ans += solve(pos + 1, nested);
  if (ans >= mod) ans -= mod;
  if (ans < 0) ans += mod;
  return ans;
}
int main() {
  memset(dp, -1, sizeof(dp));
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", str[i]);
  printf("%d\n", solve(0, 0));
}
