#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mem(a,val) memset(a,(val),sizeof((a)))
#define FAST std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define decimal(n)  cout << fixed ; cout << setprecision((n));
#define mp make_pair
#define eb emplace_back
#define f first 
#define s second
#define all(v) v.begin(), v.end()
#define endl "\n"
#define lcm(m,n) (m)*((n)/__gcd((m),(n)))
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(ll (i)=1;(i)<(n);(i)++)
#define repa(i,n,a) for(ll (i)=(a);(i)<(n);(i)++)
#define repr(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define vll vector<ll>
#define sz(x) (ll)x.size()
#define ub upper_bound
#define lb lower_bound
#define pcnt(x) __builtin_popcountll(x)
const long long N=1e4+10;
const long long NN=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;
template<typename T,typename T1>T maxn(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T minn(T &a,T1 b){if(b<a)a=b;return a;}
 
 
ll abc[61];
void pre()
{
  abc[0]=1;
  for(int i=1;i<=60;i++)
  {
    abc[i]=abc[i-1]*2;
  }
}
 
void solve()
{
  //code begins from here//
  ll n;
  cin>>n;
  string s[n+1];
  rep1(i,n+1)cin>>s[i];
  ll ans=0;
  for(int i=n;i>=1;i--)
  {
    if(s[i]=="OR")
    {
      ans+=abc[i];
    }
  }
  ans++;
  cout<<ans;
}
 
signed main()
{
FAST
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int testcase=1;
//cin>>testcase;
  pre();
while(testcase--) solve();
return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
using ll = long long;
using P = tuple<ll, ll, int>;

int main() {
    int n; cin >> n;
    vector<P> ps;
    rep(i, n) {
        ll x, y;
        cin >> x >> y;
        ps.emplace_back(x, y, i);
    }

    vector<bool> pushed(n);
    vector<P> use;
    auto push = [&]() -> void {
        rep(i, 3) {
            auto[x, y, id] = ps[i];
            if(pushed[id]) continue;
            use.push_back(ps[i]);
            pushed[id] = true;
        }
        rep(_i, 3) {
            int i = n - 1 - _i;
            auto[x, y, id] = ps[i];
            if(pushed[id]) continue;
            use.push_back(ps[i]);
            pushed[id] = true;
        }
    };

    sort(ps.begin(), ps.end());
    push();
    sort(ps.begin(), ps.end(), [&](auto a, auto b) {
        auto[x, y, i] = a;
        auto[xb, yb, ib] = b;
        return y < yb;
    });
    push();

    vector<int> dist;
    for(auto &[x, y, i] : use) {
        for(auto &[x2, y2, i2] : use) {
            if(i == i2) continue;
            ll d = max(abs(x - x2), abs(y - y2));
            dist.push_back(d);
        }
    }

    sort(dist.rbegin(), dist.rend());

    cout << dist[2] << '\n';
    return 0;
}
