#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<algorithm>
using namespace std;

int main(){
    int N;
    std::cin >> N;
    vector<string> S_list(N);
    for(int i= 0; i < N; i++){
        std::cin >> S_list[i];
    }
    vector<long long> t_list(N+1), f_list(N+1);
    t_list[0] = 1;
    f_list[0] = 1;
    
    for(int i = 0; i < N; i++){
        if(S_list[i] == "OR"){
            t_list[i+1] = 2 * t_list[i] + f_list[i];
            f_list[i+1] = f_list[i];
        }else{
            t_list[i+1] = t_list[i];
            f_list[i+1] = t_list[i] + 2 * f_list[i];
        }
    }

    std::cout << t_list[N];

}

#include<bits/stdc++.h>
#define ll         long long
#define fl(i,n)    for(i=0;i<n;i++)
#define fld(i,a,b) for(i=a;i>b;i--)
#define fli(i,a,n) for(i=a;i<n;i++)
#define pb         push_back
#define mp         make_pair
#define F          first 
#define S          second
#define mod        1000000007
#define all(x)     x.begin(),x.end()    
#define speedup    ios_base::sync_with_stdio(false),cin.tie(0)
#define N 1000005
using namespace std;

ll power(ll x, ll y){ll out = 1;while (y > 0){if (y & 1) out=(out*x);y = y>>1;x = (x*x);}return out;}
ll inverse(ll a){return power(a,mod-2)%mod;}
void comp() {
	ll i,j,k,m,n;
	cin>>n;
	vector<string>v1;
	string s;
	fl(i,n) {
		cin>>s;
		v1.pb(s);
	}
	reverse(v1.begin(),v1.end());
	ll ans = 1;
	fl(i,n) {
		if(v1[i] == "OR") {
			ans += power(2,n-i);
		}
	}
	cout<<ans<<"\n";
}
int32_t main() {
    speedup;
    ll i=0,t;
    t=1;
    //cin>>t;
    while(t--) {
        comp();
    }
    return 0;
}