#include <bits/stdc++.h>
using namespace std;
long long int i = 0, j = 0, k = 0, t = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N;
  cin >> N;
  char arr[N + 1];
  for (i = 1; i <= N; i++) cin >> arr[i];
  int flag = 0, slag = 0, counter = 1;
  for (i = 1; i <= N; i++) {
    if (arr[i] == 'f' && flag == 0) {
      flag++;
      slag += 1;
    } else if (arr[i] == 'f' && flag != 0 && slag > 0) {
      flag++;
    } else if (arr[i] == 's' && flag != 0 && slag != 0) {
      slag--;
    } else if (arr[i] == 's' && flag != 0 && slag == 0) {
      (counter += (counter * flag)) + 1;
    } else if (arr[i] == 'f' && flag != 0 && slag == 0) {
      flag += 1;
      slag += 1;
      counter *= flag;
    }
  }
  if (counter == 0)
    cout << 1 << endl;
  else
    cout << counter << endl;
  return 0;
}
