#include <bits/stdc++.h>
using namespace std;
unsigned long long int power(unsigned long long int x,
                             unsigned long long int y) {
  if (y == 0) return 1;
  unsigned long long int temp = power(x, y / 2) % 1000000007;
  if (y & 1) return (((temp * temp) % 1000000007) * x) % 1000000007;
  return (temp * temp) % 1000000007;
}
string s;
int n, d = 1;
int a[5005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  s = "";
  cin >> n;
  char x;
  a[0] = 1;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == 'f')
      d++;
    else
      for (int i = 1; i < d; i++) a[i] = (a[i] + a[i - 1]) % 1000000007;
  }
  cout << a[d - 1];
  return 0;
}
