#include<iostream>
#include<string>
#include<cctype>
using namespace std;
int main(){
  string a;
  int i,j,c=0,f=0;
  cin>>a;
  for(i=0;i<a.length();i++){
      if(isupper(a[i])){
          f++;
      }
  }
  if(f==3){
  for(i=0;i<a.length();i++){
      if((i+1)<a.length()){
       if(a[i]!=a[i+1]){
       c++;
       }
      }
  }
  if(c>0){cout<<"Lost"<<endl;}
  else{cout<<"Won"<<endl;}
  }
  else{
      cout<<"Lost"<<endl;
  }
        return 0;
}
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <math.h>
#include <algorithm>
#include <numeric>
using namespace std;
int main() {
	long long N;
	cin >> N;
	vector<int> v;
	int i;
	for (i = 0; N > 0; i++) {
		v.push_back(N % 10);
		N /= 10;
	}
	if (accumulate(v.begin(), v.end(), 0) % 3 == 0) {
		cout << 0;
		return 0;
	}
	for (int k = 1; k < i; ++k) {
		for (int j = 0; j + k - 1 < i; ++j) {
			if ((accumulate(v.begin(), v.end(), 0)-accumulate(v.begin() + j, v.begin() + j + k, 0) )% 3 == 0) {
				cout << k;
				return 0;
			}
		}
	}
	cout << -1;
	return 0;
}
