#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e3+9;
const int MAX=1e2+9;
const double ep=1e-4;
const double ep1=1e-6;
const int mod=77797;
const double inf=1e20;
const double pi=acos(-1);
#define debug1 puts("?");
#define debug(x) cout<<"##"<<(x)<<endl;
#define mk make_pair
#define PII pair<int,int>
#define PDI pair<double,int>
#define PIII pair<int,PII >
#define PIII1 pair<PII,int>
#define PIIII pair<PII,PII >
#define PIL pair<int,ll>
#define PLI pair<ll,int>
#define PLIII pair<PLI,PII >
#define PLL pair<ll,ll>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define dep(i,a,b) for(int i=(a);i>=(b);--i)
#define sd(x) scanf("%d",&(x))
#define slld(x) scanf("%lld",&(x))
#define sdd(x,y) scanf("%d%d",&(x),&(y))
#define sc(s) scanf("%s",(s))
#define pd(x) printf("%d\n",(x))
#define plld(x) printf("%lld\n",(x))
#define pdk(x) printf("%d ",(x))
#define plldk(x) printf("%lld ",(x))
#define pdd(x,y) printf("%d %d\n",(x),(y))
#define PR(x) printf("Case %d: ",(x))
#define INF 0x3f3f3f3f
typedef unsigned long long ull;
/*
*/
ll dp[64][2];
int n;
char s[5];
void solve()
{
	sd(n);
	dp[0][0]=dp[0][1]=1;
	rep(i,1,n)
	{
		sc(s);
		if(s[0]=='A')
		{
			dp[i][0]=(dp[i-1][0]*2+dp[i-1][1]);
			dp[i][1]=dp[i-1][1];
		}
		else
		{
			dp[i][1]=(dp[i-1][0]+dp[i-1][1]*2);
			dp[i][0]=dp[i-1][0];
		}
	}
	plld(dp[n][1]);
}
int main()
{
//    ios::sync_with_stdio(false);
//    cin.tie(0);
    int T=1;
//    sd(T);
    while(T--)solve(); 
}
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <random>
#include <list>
#include <array>
#include <fstream>
#include <chrono>
typedef long long ll;
typedef long double ld;
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<vector<ll> > dp(n + 1, vector<ll>(2, 0));
	dp[0][0] = dp[0][1] = 1;
	for (int i = 0; i < n; i++)
	{
		string s;
		cin >> s;
		for (int prev = 0; prev < 2; prev++)
		{
			for (int now = 0; now < 2; now++)
			{
				if (s == "AND")
				{
					dp[i + 1][prev & now] += dp[i][prev];
				}
				else
				{
					dp[i + 1][prev | now] += dp[i][prev];
				}
			}
		}
	}
	cout << dp[n][1] << "\n";
	return 0;
}