// Created by vamsi
#define _CRT_SECURE_NO_DEPRECATE
#define _SECURE_SCL 0
#pragma comment(linker, "/STACK:200000000")
#include<bits/stdc++.h>
using namespace std;
 
#define pb push_back
#define mp make_pair
#define mset(mas,val) memset(mas,val,sizeof(mas))
#define sz(a) (int)(a).size()
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
 
#define forn(i,n) for (int i=0; i<int(n); ++i)
#define fornd(i,n) for (int i=int(n)-1; i>=0; --i)
#define forab(i,a,b) for (int i=int(a); i<int(b); ++i)
 
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
    
const int INF = (int) 1e9;
const long long INF64 = (long long) 1e18;
long double eps = 1e-6;
const long double pi = 3.14159265358979323846;
 
const int N = 1e6 + 100;
long long fact[N], modulo = INF + 7;
 
long long binpow(long long val, long long deg, long long mod) {
    if (!deg) return 1 % mod;
    if (deg & 1) return binpow(val, deg - 1, mod) * val % mod;
    long long res = binpow(val ,deg >> 1, mod);
    return (res*res) % mod;
}
/////////////////////////////////template ends//////////////////////////////////////////
int n;
vector<int> a;

ll ans = 0;

ll countIt(int ind){
	if( ind == 0){
		return 1;
	}
	else{
		ll ans = 0;
		if( a[ind-1] == 2) ans = (1ll<< (ind)) + countIt(ind-1);
		else ans = countIt(ind-1);
		return ans;
	}
}


void solve() {
     
     cin >> n;
     forn(i,n){
     	string s;
     	cin >> s;
     	if( s == "AND") a.push_back(1);
     	else a.push_back(2);
     }   
    cout << countIt(n) << endl;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int tc = 1;
    //cin >> tc;
    while(tc--) solve();
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef   long double ld;
#define syncboost ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
#define mp make_pair
#define pb push_back
#define psy push
#define pp pop_back
#define pl pair<ll,ll>
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vpl vector<pair<ll,ll>>
#define all(x) x.begin(),x.end()
#define precise(n) cout << fixed; cout << setprecision(n)
#define forn(i, n) for (ll i = 0; i < ll(n); i++)
#define setbit(x) __builtin_popcount(x)
#define run(i, v) for(auto &i: v)
#define hike(i, v) for(const auto &i: v)
#define srt(v) sort(v.begin(),v.end())
#define mem(x,val) memset(x,val,sizeof(x))
#define rep(i,init,n) for(ll i = init;i<n;i++)
#define rrep(i,n,init) for(ll i = n;i>=init;i--)
#define fi first
#define se second
long double pi = 3.14159265;
#define show(x) cerr << x
#define deb1(x) cout<<x<<"\n";
#define deb(x) show(#x << ": " << (x) << endl);
#define debn(x) show((x) <<" ");
#define debv(x) for(auto it : x ) debn(it);deb("\n");
#define det(x) cout<<x<<"\n";
#define No cout<<"No\n";
#define Yes cout<<"Yes\n";
#define YES cout<<"YES\n";
#define NO cout<<"NO\n";
#define sp " "
#define nl cout<<"\n";
#define ps(x,y)   fixed<<setprecision(y)<<x
const ll  mod  = 1000000007; 
//const ll  mod  =998244353;
ll power(ll a, ll b, ll m)
{
  if(a == 0) return 0;
  if(b == 0) return 1;
  if(b == 1) return a % m;
  ll temp = power( a , b / 2 , m );
  temp = ( temp * temp ) % m;
  if(b % 2)
    temp = (a * temp) % m;
  return temp;
} 
 ll modinv(ll x) {
    return power(x,mod-2,mod);
}
 
ll dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
 
const ll N = 1e15; 
#define ll long long
map<int,set<int>> mpp;
ll dp[105][10005];
ll n;

ll go(ll mask , ll id)
{
  if(id>=101)
  {
    if(mask == ((1<<n)-1))
      return dp[id][mask] = 1;
    else
      return dp[id][mask] = 0;

  }

   if(dp[id][mask] !=  -1)
    return dp[id][mask];
  ll  ans = go(mask,id+1) %mod;
  for(int i = 0;i<n;i++)
  {
    if(((mask&(1<<i)) == 0) && mpp[i].find(id) != mpp[i].end()) 
      {
        ans += go((mask| (1<<i)) ,id+1) %mod;
        ans%= mod;
      }


  }
  return dp[id][mask] = ans; 

}
void solve() { 
   ll i, n, j, m, k, l, t;
    cin >> n;
    string s[n];
    rep(i,0,n) cin >> s[i];
    k=1;
   rep(i,0,n)
        if(s[i][0]=='O') k += (1LL<<(i+1));
    
    cout << k;
  return;
 }
 
signed  main()
{
    ll test = 1;   
  //syncboost;
  //cin>> test; 
   rep(testcase,1,test+1)
    {   
    //   cout<<"Case #"<<testcase<<": ";
       solve();
 
       //nl
    }
 //cerr<<"Time : "<<1000*((double)clock())/(double)CLOCKS_PER_SEC<<"ms\n";
 
   return 0;
}
 