#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 998244353;//1000000007;
constexpr long long INF = 1000000000 + 100;
constexpr long long LINF = 1000000000000000000 + 100;
constexpr double EPS = 1e-9;
#define all(v) v.begin(), v.end()
#define rep(i, n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
#define rrep(i, n) for(int i=(n); i>=0; i--)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


//dp[i][j]:=i番目まで見て、j=1ならtrue, 0ならfalseの数
ll dp[66][2];
int main(){
    int N; cin >> N;
    vector<string> S(N); rep(i, N)cin >> S[i];

    dp[0][0] = dp[0][1] = 1;
    rep(i, N){
        rep(j, 2){
            if(S[i]=="AND"){
                rep(k, 2){
                    dp[i+1][j and k] += dp[i][j];
                }
            }
            else{
                rep(k, 2){
                    dp[i+1][j or k] += dp[i][j];
                }
            }
        }
    }
    cout << dp[N][1] << ln;
}
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define FastIO cin.sync_with_stdio(false), cin.tie(nullptr)
#define pb push_back
#define fs first
#define sc second
#define mkp make_pair
#define endl '\n'

// IO
#define multitest signed __T; cin >> __T; while(__T--)
template<typename T>
void _read(T& t);
template<typename T>
void _read(vector<T>& v);
template<typename T1, typename T2>
void _read(pair<T1, T2>& p);
template<typename T>
void _read(T& t) { cin >> t; }
template<typename T>
void _read(vector<T>& v) { for (unsigned _i = 0; _i < v.size(); _i++)_read(v[_i]); }
template<typename T1, typename T2>
void _read(pair<T1, T2>& p) { _read(p.first); _read(p.second); }
void _masterread() {}
template<typename T, typename... V>
void _masterread(T& t, V& ... v) { _read(t); _masterread(v...); }
#define re(...)_masterread(__VA_ARGS__)

template<typename T>
void _print(T t);
template<typename T>
void _print(vector<T>& v);
template<typename T1, typename T2>
void _print(pair<T1, T2>& p);
template<typename T>
void _print(T t) { cout << t; }
template<typename T>
void _print(vector<T>& v) { for (unsigned _i = 0; _i < v.size(); _i++)_print(v[_i]), cout << (_i == v.size() - 1 ? "" : " "); }
template<typename T1, typename T2>
void _print(pair<T1, T2>& p) { _print(p.first); cout << " "; _print(p.second); }
void _masterprint() { cout << endl; }
template<typename T, typename... V>
void _masterprint(T t, V... v) { _print(t); if (sizeof...(v))cout << " "; _masterprint(v...); }
#define pr(...)_masterprint(__VA_ARGS__)

// DEBUG
// colored output???
template <typename T> // start forward declaration
void _debug(T t);
template<typename T1, typename T2>
void _debug(pair<T1, T2> p);
template<typename T>
void _debug(vector<T>v);
template <typename T> // end forward declaration
void _debug(T t) { cerr << t; }
template<typename T1, typename T2>
void _debug(pair<T1, T2> p) { cerr << "{"; _debug(p.first); cerr << ", "; _debug(p.second); cerr << "}"; }
template<typename T>
void _debug(vector<T>v) { cerr << "("; for (unsigned _i = 0; _i < v.size(); _i++)_debug(v[_i]), cerr << (_i == v.size() - 1 ? "" : ", "); cerr << ")"; }
void _masterdebug() { cerr << "]\n"; }
template<typename T, typename... V>
void _masterdebug(T t, V... v) { _debug(t); if (sizeof...(v))cerr << ", "; _masterdebug(v...); }
#define debug(...) cerr<<"["<<#__VA_ARGS__<<"] = [";_masterdebug(__VA_ARGS__)
#define int long long

void solve() {
	string s;
	cin >> s;
	char c1 = s[0], c2 = s[1], c3 = s[2];
	if (c1 == c2 && c2 == c3) {
		pr("Won");
	}
	else
		pr("Lost");
}

signed main() {
	FastIO;
	/*int t;
	cin >> t;
	while (t--)*/
		solve();
}