#include<bits/stdc++.h>
using namespace std;
const int N = 67;
int S[N] , n;

long long x[N][2] , y[N][2] ;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    string t;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>t;
        if(t=="AND")
            S[i] = 0;
        else
            S[i] = 1;
    }

    x[0][0] = x[0][1] = y[0][0] = y[0][1] = 1;

    for(int i=1;i<=n;i++){
        if(S[i] == 1){
            y[i][1] = y[i-1][1]*2+y[i-1][0];
            y[i][0] = y[i-1][0];
        }
        else{//AND
            y[i][1] = y[i-1][1];
            y[i][0] = y[i-1][0]*2+y[i-1][1];
        }
    }

    cout<<y[n][1]<<endl;

    return 0;
}

#include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
#define int long long int
#define endl "\n"
#define pb push_back
int sum = 0;
#define arrinp(v) for(auto &i:v) cin>>i,sum+=i;
#define arrout(v) for(auto &i:v) cout<<i<<" ";
#define newline cout<<endl;
#define all(s) (s).begin(),(s).end()
#define dbg(a) cout<<a<<endl;
#define dbg2(a,b) cout<<a<<" "<<b<<endl;
using namespace std;
// using namespace __gnu_pbds;
// typedef tree<int,null_type,less<int>, rb_tree_tag,
//             tree_order_statistics_node_update> new_data_set;
//             // order_of_key(int)  k-th largest element
//             // find_by_order(int) gives us according to the order
//             // insert() to insert in the PBDS
//             // new_data_set ST; calling
int fastModExp(int a, int b) {
    int res = 1;
    while (b > 0) {
        if (b & 1){
            res = (res * a);
        }
        a = (a * a);
        b = b >> 1;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t(1);
    // cin >> t;
    while (t--) {
        sum = 1;
        int n;
        cin>>n;
        vector<int> v;
        for(int i=0;i<n;i++){
            string s;
            cin>>s;
            if(s[0]=='O'){
                v.pb(i+1);
            }
        }
        for(int i=0;i<v.size();i++){
            sum+=fastModExp(2,v[i]);
        }
        cout<<sum<<endl;
    }
    return 0;
}