#include<bits/stdc++.h>
using namespace std;

int main(){
  int n; cin >> n;
  vector<int> a;
  
  long long ans = 1;
  for(long long i = 1; i <= n; ++i){
    string s; cin >> s;
    if(s == "OR"){ans += (long long)pow(2, i);}
  }  
  cout << ans << endl;
}

#include <cstring>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
int n;
ll dp[100][2] = { 0 };
int main()
{
    cin >> n;
    vector<string> s(n, "");
    for (int i = 0; i < n; ++i) {
        cin >> s[i];
    }
    dp[0][0] = dp[0][1] = 1;
    for (int i = 1; i <= n; ++i) {
        if (s[i - 1] == "AND") {
            dp[i][1] = dp[i - 1][1];
            dp[i][0] = dp[i - 1][1] + dp[i - 1][0] * 2;
        } else {
            dp[i][0] = dp[i - 1][0];
            dp[i][1] = dp[i - 1][1] * 2 + dp[i - 1][0];
        }
    }
    cout << dp[n][1] << endl;
    return 0;
}
