#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define f(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
#define pb push_back
using namespace std;
string s[70];
ll n;
ll cache[70][2];
ll dp(ll i, ll j){
if(i==n and j==1)
return 1;
else if(i==n)
return 0;
if(cache[i][j]!=-1)
return cache[i][j];
ll res = 0;
if(s[i]=="OR"){
// using 1
res = res + dp(i+1,1);
// using 0
res = res + dp(i+1,j);
}else{
res = res + dp(i+1,j&1);
res = res + dp(i+1,0);
}
cache[i][j] = res;
return res;
}
void test(){
cin>>n;
f(i,n)cin>>s[i];
memset(cache,-1,sizeof(cache));
cout<<dp(0,0) + dp(0,1)<<"\n";
}
int main(){
std::ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int tests=1;
// cin>>tests;
while(tests--){
test();
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBsbCBsb25nIGxvbmcgCiNkZWZpbmUgbXAgbWFrZV9wYWlyIAojZGVmaW5lIGYoaSxuKSBmb3IoaW50IGk9MDtpPG47aSsrKSAKI2RlZmluZSBGIGZpcnN0IAojZGVmaW5lIFMgc2Vjb25kIAojZGVmaW5lIHBiIHB1c2hfYmFjayAKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpzdHJpbmcgc1s3MF07CmxsIG47CmxsIGNhY2hlWzcwXVsyXTsKCmxsIGRwKGxsIGksIGxsIGopewoJaWYoaT09biBhbmQgaj09MSkKCQlyZXR1cm4gMTsKCWVsc2UgaWYoaT09bikKCQlyZXR1cm4gMDsKCWlmKGNhY2hlW2ldW2pdIT0tMSkKCQlyZXR1cm4gY2FjaGVbaV1bal07CglsbCByZXMgPSAwOwoJaWYoc1tpXT09Ik9SIil7CgkJLy8gIHVzaW5nIDEKCQlyZXMgPSByZXMgKyBkcChpKzEsMSk7CgkJLy8gdXNpbmcgMAoJCXJlcyA9IHJlcyArIGRwKGkrMSxqKTsKCX1lbHNlewoJCXJlcyA9IHJlcyArIGRw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