#include <bits/stdc++.h>
using namespace std;
long long power(int y) {
   int i; long long power=1;
   if(y == 0)
   return 1;
   for(i=1;i<=y;i++)
   power=power*2;
   return power;
}
int main() {
	int n;
	cin >> n;
	string s[n];
	for(int i = 0; i < n; i++) cin >> s[i];
	long long x = 1;
	for(int i = 0; i < n; i++){
	    if(s[i] == "OR"){
	        x = x + power(i + 1);
	    }
	}
	cout << x;
	return 0;
}

#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<long long> dp(2,1);
    for(int i = 0; i < n;++i){
        string s;
        cin >> s;
        vector <long long > p(2,0);
        swap (dp,p);
        for(int j = 0; j < 2;++j){
            for(int x = 0;x < 2; ++x){
                int nj = j;
                if(s == "AND"){
                    nj &= x;
                }
                else nj |= x;
                dp[nj] += p[j];
            }
        }
    }
    cout << dp[1] << endl;
    return 0;
}
/*long long count(string S[],long long n){
    if(n == 0){
        return 1;
    }
    else if(S[n-1] == "OR"){
        return (pow(2,n) + count(S,n-1));
    }
    else return count(S,n-1);
}
/*int main()
{
    long long n;
    cin >> n;
    string S[n];
    if(n == 0){
        cout << 0 << endl;
        return 0;
    }
    for(long long i = 0; i < n; ++i){
        cin >> S[i];
    }
    
    cout << count(S,n) << endl;
    return 0;
    /*int cnt = 0;
    for(int bit = 0; bit < (1<<(n+1)); ++bit){
        int bitset[n+1] = {0};
        for(int k = 0; k <= n; ++k){
            int Div = (1 << k);
            bitset[k] = (bit / Div) % 2;
        }
        int y[n+1];
        y[0] = bitset[0];
        for(int i = 1; i <= n; ++i){
            if(S[i-1] == "AND"){
                y[i] = y[i-1] & bitset[i];
            } 
            else y[i] = y[i-1] | bitset[i];
        }
        if(y[n] == 1){
            cnt++;
        }
    }
    cout << cnt << endl;
}*/
