#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define Pii pair<int,int>
#define Pll pair<long long,long long>
#define fout(num) cout << fixed << setprecision(20) << (num) << endl
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
//vector<vector<ll>> dp(n,vector<ll>(n))
//2-dim:vector<vector<Type>> vv(n, vector<Type>(m, d));
//3-dim:vector<vector<vector<Type>>> vvv(n, vector<vector<Type>>(m, vector<Type>(l, d)));

using namespace std;

signed main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    int n; cin >> n;
    ll ans0=1,ans1=1;
    rep(i,n){
        string s; cin >> s;
        if(s=="OR"){
            ans1 = ans0+ans1*2;
        }else{
            ans0 = ans0*2+ans1;
        }
    }
    cout << ans1 << endl;

    return 0;
}
// g++ main.cpp -o a.out && ./a.out
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
long long dp[65][2];
int main()
{
    dp[0][1] = 1;
    dp[0][0] = 1;
    int int_n;
    scanf("%d",&int_n);
    for(int i = 1; i <= int_n; i++)
    {
        string s;
        cin >> s;
        if(s == "AND"){
            dp[i][0] = dp[i-1][1] * 1 + dp[i-1][0] * 2;
            dp[i][1] = dp[i-1][1] * 1 + dp[i-1][0] * 0;
        }
        else{
            dp[i][0] = dp[i-1][1] * 0 + dp[i-1][0] * 1;
            dp[i][1] = dp[i-1][1] * 2 + dp[i-1][0] * 1;
        }
    }
    printf("%lld\n",dp[int_n][1]);
}
//系统提示：哔哩哔哩直播内容及互动评论须严格遵守直播规范，
//严禁传播违法违规、低俗血暴、吸烟酗酒、造谣诈骗等不良有害信息。
//如有违规，平台将进行封禁直至永久封停账号哦！注意理性打赏，
//严禁未成年人直播或打赏。请勿轻信平台上各类广告信息，谨防上当受骗。
