#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>
#include <cstddef>
#include <type_traits>
#include <vector>

using namespace std;
using lint = long long int;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;

template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}

#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define rep(i, n) for(int i=0;i<(int)(n);i++)


int main() {
  
  int n; cin >> n;
  vector<vector<lint>> dp(n + 1, vector<lint>(2, 0));
  dp[0][0] = 1;
  dp[0][1] = 1;
  for (int i = 0; i < n; i++) {
    string s; cin >> s;
    for (int j = 0; j < 2; j++) {
      if (dp[i][j] == 0) continue;

      for (int jj = 0; jj < 2; jj++) {
        int nj;
        if (s == "AND") nj = j & jj;
        else            nj = j | jj;

        dp[i + 1][nj] += dp[i][j];
      }
    }
  }

  cout << dp[n][1] << endl;
  return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <bitset>
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<string> s(N);
  for (int i=0;i<N;i++)
    cin >> s.at(i);
  
  long long t=1;
  long long f=1;
  
  for(int j=0; j<N; j++){
    if(s.at(j)=="AND"){
      f= f*2 + t;
    }else{
      t = t*2 + f;
    }
  }
  cout << t << endl;
}