#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll dp[65][3];
string S[65];

int main()
{
	int N;
	cin >> N;
	rep(i,N)
	{
		cin >> S[i];
	}

	dp[0][1] = 1;
	dp[0][0] = 1;
	rep(i,N)
	{
		if (S[i] == "AND")
		{
			dp[i+1][1] = dp[i][1];
			dp[i+1][0] = 2 * dp[i][0] + dp[i][1];
		}
		else
		{
			dp[i+1][1] = dp[i][0] + 2 * dp[i][1];
			dp[i+1][0] = dp[i][0];
		}
	}
	cout << dp[N][1] << endl;
	return 0;
}
#include <bits/stdc++.h>
#include <string>
#include <map>
#include <set>
#include <sstream> 
#include <queue>
#include <stack>
#include <deque>
#include <vector>
 
#define loop(i,a,b) for (int i = (a); i <= (b); i++)
#define loopr(i, a, b) for(int i = (a); i >= (b); i--)
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define pf 				push_front
#define mp              make_pair
#define mt              make_tuple
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(x) (int)x.size()
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define fast_io ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define mod 1000000007
#define mod1 998244353
using namespace std; 
 
int fast_pow(int a, int p) {
  int res = 1;
  while (p) {
    if (p % 2 == 0) {
      a = a * 1ll * a % mod;
      p /= 2;
    } else {
      res = res * 1ll * a % mod;
      p--;
    }
  }
  return res;
}
 
int fact(int n) {
  int res = 1;
  for (int i = 1; i <= n; i++) {
    res = res * 1ll * i % mod;
  }
  return res;
}
 
int C(int n, int k) {
  return fact(n) * 1ll * fast_pow(fact(k), mod - 2) % mod * 1ll * fast_pow(fact(n - k), mod - 2) % mod;
}
 
vector<int> sieveOfEratosthenes(int n) {
	vector<int> primes;
	vector<bool> prime(n+1,true);
	for (int p = 2; p * p <= n; p++) {
		if (prime[p] == true) {
			for (int i = p * p; i <= n; i += p)
				prime[i] = false;
		}
	}
	for (int p = 2; p <= n; p++)
		if (prime[p])
			primes.push_back(p);
	return primes;
}
 
 
bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
  
    // This is checked so that we can skip  
    // middle five numbers in below loop 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
 
int highestPowerof2(int n) 
{ 
   int p = (int)log2(n); 
   return (int)pow(2, p);  
} 

int modd(string num, int a) 
{ 
    // Initialize result 
    int res = 0; 
  
    // One by one process all digits of 'num' 
    for (int i = 0; i < num.length(); i++) 
         res = (res*10 + (int)num[i] - '0') %a; 
  
    return res; 
}  

int32_t main()
{	
	fast_io;
	int n;
	cin>>n;
	vector<string> s(n);
	loop(i,0,n-1)
	{
		cin>>s[i];
	}
	int ans = 1;
	loop(i,0,n-1)
	{
		if(s[i]=="OR")
		{
			ans+= 1LL<<(i+1);
		}
	}
	cout<<ans<<endl;
}