#include <bits/stdc++.h>
using namespace std;
#define ll  long long
#define int ll
#define vi vector<int>
#define pii pair<int,int>
#define piii pair<int, pii>
#define pb push_back
#define fs first
#define sc second
//#define ONLINE_JUDGE
#define endl "\n"
#define pow2(i) (1<<(i))  
#define d0(x) cout<<x<<" "
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl
#define d4(x,y,z,w) cout<<x<<" "<<y<<" "<<z<<" "<<w<<endl
#define d5(x,y,z,w,s) cout<<x<<" "<<y<<" "<<z<<" "<<w<<" "<<s<<endl
#define fifo ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define precise(x) cout<<fixed<<setprecision(x)
#define all(v) (v).begin(),(v).end()
const int mod = 1e9+7;


int dig(int x)
{
	int ret = 0;
	while(x)
	{
		x/=10;
		ret++;
	}
	return ret;
}

int po(int x)
{
	if(x==0)return 1;
	return 10*po(x-1);
}
int bin(int l,int r,int n)
{
	if(l==r)return l;
	int m=(l+r+1)/2;

	if(m+m*po(dig(m))<=n)
		return bin(m,r,n);
	else
		return bin(l,m-1,n);



}
void solve()
{
	int n;
	cin>>n;

	if(n<=10)
	{
		cout<<0<<endl;return;
	}
	cout<<bin(1,1000000,n)<<endl;
}
 
 
signed main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif
 
    fifo
    int t=1;

    //cin>>t;

    for(ll tc=1;tc<=t;++tc)
    {
        solve();
    }
}





#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  if((s[0]==s[1]) && (s[1]==s[2]))
    cout<<"Won"<<'\n';
  else
    cout<<"Lost"<<'\n';
  return 0;
}