#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#define itrout(x) for(int i=0;i<x.size();i++) {cout << x[i] << (i==x.size()-1 ? "\n" : " ");}
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define debugbit(x, n) cerr << #x << " = " << bitset<n>(x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define itrdebug(x) cerr << #x << " "; for (auto & el : (x)) {cerr << (el) << " ";} cerr << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define debug(x)
#define debugbit(x, n)
#define itrdebug(x)
#define dassert(...)
#endif
//#define int long long
//using mint = atcoder::modint;

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

void solve(long long x){
    cout << ((x >= 0) ? x : 0) << endl;
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    long long x;
    scanf("%lld",&x);
    solve(x);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<pair<ll,ll> > vpl;//追加はmake_pairを使う
typedef long double ld;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqg; //昇順のPriority queue
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define all(v) v.begin(), v.end()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0;}
#define dbl(i) fixed << setprecision(15) << i << endl;
#define GET_VARIABLE_NAME(Variable) (#Variable)
#define dbc(a) cout << GET_VARIABLE_NAME(a) << "=" << a << endl;
#define vsum(v) accumulate(all(v), 0);
#define rsort(v) sort(v.begin(),v.end(),greater<ll>());
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }
    // 素数である
    return true;
}
vector<ll> enum_divisors(ll N) {//約数列挙
    vector<ll> res;
    for (ll i = 1; i * i <= N; ++i) {
        if (N % i == 0) {
            res.push_back(i);
            // 重複しないならば i の相方である N/i も push
            if (N/i != i) res.push_back(N/i);
        }
    }
    // 小さい順に並び替える
    sort(res.begin(), res.end());
    return res;
}
vector<pair<long long, long long> > prime_factorize(long long N) {//因数分解
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        pair <ll,ll> push;
        push.first=a;
        push.second=ex;
        res.push_back(push);
    }

    // 最後に残った数について
    if (N != 1){
        pair <ll,ll> push;
        push.first=N;
        push.second=1;
        res.push_back(push);
    }
    return res;
}
ll gcd(ll a, ll b){//最大公約数
        if (a%b == 0){
            return(b);
        }else{
            return(gcd(b, a%b));
        }
    }
ll lcm(ll a, ll b){//最小公倍数
   return a / gcd(a, b) * b;
}
ll comb(ll n, ll r) {
if(n<r) return 0;
  if ( r * 2 > n ) r = n - r;
  ll dividend = 1;
  ll divisor  = 1;
  for ( ll i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}
void exgcd(ll a,ll b,ll &x,ll &y)
{
	if(b==0){ x=1;y=0; }
	else{ exgcd(b,a%b,y,x);y-=a/b*x; }
}
ll inv(ll a,ll Mod){//modにおけるaの逆元
	ll x,y;
	exgcd(a,Mod,x,y);
	return (x%Mod+Mod)%Mod;
}
ll RepeatSquaring(ll N, ll P, ll M){
    if(P==0) return 1;
    if(P%2==0){
        ll t = RepeatSquaring(N, P/2, M);
        return t*t % M;
    }
    return N * RepeatSquaring(N, P-1, M);
}
ll rui(ll a,ll n){
    ll x=1;
    while(n>0){
        if(n&1){
            x=x*a;
        }
        a=a*a;
        n>>=1;
    }
    return x;
}

ll f(ll n, vector <string>s){
    if(s[n]=="OR"){
        if(n==0)return 3;
        return rui(2,n+1)+f(n-1,s);
    }else{
        if(n==0)return 1;
        return f(n-1,s);
    }
}

int main(){
    ll n;
    cin>>n;
    vector <string>s(n);
    rep(i,n) cin>>s[i];
    ll ans=f(n-1,s);
    cout<<ans<<endl;

}