#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<vector>
#include<cstring>
#include<map>
#include<set>
#include<cstdlib>
#include<bitset>
using namespace std;
#define FAST ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
typedef long long ll;
ll a[66];
ll n;
int main(void)
{
	scanf("%lld",&n);
	for(int i=1;i<=n;i++)
	{
		string s;
		cin>>s;
		if(s=="OR") a[i]=1;
		else a[i]=0;
	}
	ll ans=0;
	a[0]=1;
	for(ll i=n;i>=0;i--)
	{
		if(a[i]==1) ans+=(1ll<<i);
	}
	printf("%lld\n",ans);
}
#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<algorithm>
#include<iomanip>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;

const ll LLMAX = (1llu<<(sizeof(ll)*8-1)) - 1;
const int IMAX = (1llu<<(sizeof(int)*8-1)) - 1;

int N;
string s[100];


ull dp[100][2];

int main(){
  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> s[i];
  }
  // 0 = false, 1 = true;
  dp[0][0] = 1;
  dp[0][1] = 1;
  for(int i = 1; i <= N; i++){
    if(s[i-1][0] == 'A'){
      dp[i][0] = dp[i-1][0] * 2 + dp[i-1][1];
      dp[i][1] = dp[i-1][0] * 0 + dp[i-1][1];
    } else{
      dp[i][0] = dp[i-1][0];
      dp[i][1] = dp[i-1][0] + dp[i-1][1] * 2;
    }
    // for(int r = 0; r <= i; r++){
    //   for(int c = 0; c <= 1; c++){
    //     cerr << dp[r][c] << "\t";
    //   }
    //   cerr << endl;
    // }
  }
  cout << dp[N][1] << endl;
  return 0;
}
