#include <bits/stdc++.h>

#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法
#define MOD2 1000007

using namespace std;
typedef long long ll;

/*
0のアスキー　"48"
*/

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) x.begin(),x.end()
#define chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))

typedef std::priority_queue<ll> LLPrioQueue;
typedef std::priority_queue<ll, std::vector<ll> , std::greater<ll> > LLReversePrioQueue;

int main(){

    int N;
    cin >> N;
    vector<string> s(N);
    for(ll i = 0;i < N;i++)
        cin >> s.at(i);
    vector<ll> A(N,0);
    ll cnt = 1;
    for(ll i = 0;i < N;i++){
        if(s.at(i) == "AND"){
            continue;
        }else{
            ll a = 1;
            for(int j = 0;j < i+1;j++)
                a *= 2;
            cnt += a;
        }
    }

    cout << cnt << endl;

    return 0;

}
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_cxx;

template<typename T>
int ex(T p){
  T a = 1;
  if(p == 0){
    return a;
  }
  else{
    for(T i = 1; i <= p; i++){
      a = a*i%1000000007;
    }
    return a;
  }
}
template<typename T>
int eq(T p, T q){
    T r,s = 0,nextp,prevp = 0,prev2p = 1;
    if(q != 1){
        while(s != 1){
            r = p/q; s = p%q;
            nextp = prevp;
            prevp = prev2p - r * prevp;
            prev2p = nextp;
            p = q; q = s;
        }
    return prevp;
    }
    else{
      return 0;
    }
} 
template<typename T>
int com(T p,T q){
  T a,b,c,mod = 1000000007;
  a = ex(p);
  b = ex(q);
  for(T i = 1; i <= p-q; i++){
    b = b*i%mod;
  }
  if(b != 1){
    c = ((1 - eq(mod,b)*mod )/b + mod) %mod;
  }
  else{
    c = 1;
  }
  return a*c%mod;
}
template<typename T>
int gcd(T p,T q){
    T s;
    while(q != 0){
        s = p%q;
        p = q; q = s;
    }
    return p;
}
int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  vector<long long> T(N+1),F(N+1);
  T[0] = 1;F[0] = 1;
  for(int i = 0; i < N; i++){
    cin >> S[i];
    if(S[i] == "AND"){
      T[i+1] = T[i];
      F[i+1] = 2*F[i] + T[i];
    }
    else{
      T[i+1] = 2*T[i] + F[i];
      F[i+1] = F[i];
    }
  }
  cout << T[N] << endl;
}