#include <bits/stdc++.h>
using namespace std;
long long n;
char s[5005];
long long dp_cur[5005], dp_pre[5005], sm_cur[5005], sm_pre[5005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = (long long)0; i < (long long)n; i++) cin >> s[i];
  for (long long i = (long long)0; i < (long long)n; i++) {
    dp_cur[i] = 1;
    sm_cur[i] = i + 1;
  }
  for (long long i = (long long)n - 2; i >= (long long)0; i--) {
    for (long long j = (long long)0; j < (long long)i + 2; j++)
      dp_pre[j] = dp_cur[j];
    for (long long j = (long long)0; j < (long long)i + 2; j++)
      sm_pre[j] = sm_cur[j];
    for (long long j = (long long)0; j < (long long)i + 1; j++) {
      if (s[i] == 'f')
        dp_cur[j] = dp_pre[j + 1];
      else
        dp_cur[j] = sm_pre[j];
    }
    sm_cur[0] = dp_cur[0];
    for (long long j = (long long)1; j < (long long)i + 1; j++)
      sm_cur[j] = (sm_cur[j - 1] + dp_cur[j]) % 1000000007;
  }
  cout << dp_cur[0] << "\n";
}
