#include <bits/stdc++.h>
#define ll long long
const unsigned int mod = 1000000007;
using namespace std;

int main() {
    int x; cin>>x;
    if(x>=0)
        cout<<x<<endl;
    else cout<<0<<endl;
    return 0;
}
#include <bits/stdc++.h>

using namespace std;
typedef long long int64;

int64 pow10(int n)
{
    int64 ret=1;
    for(int i=0;i<n;i++)ret*=10;
    return ret;
}

int main()
{
    int64 n;
    int64 ans=0;
    cin >> n;
    int64 a=0;
    for(int i=1;i<=5;i++)
    {
        if(n<pow10(i*3))
        {
            ans+=(i-1)*(n-pow10((i-1)*3)+1);
            break;
        }
        else ans+=(i-1)*(pow10(i*3)-pow10((i-1)*3));
        //cout << i << " " << ans << endl;
    }
    if(n==1e+15)ans+=5;
    cout << ans;
}