#include<bits/stdc++.h>
using namespace std;
#define lowbit(x) (x&-x)
#define reg register
typedef long long LL;
typedef unsigned long long uLL;
typedef unsigned int uint;
const int INF=0x7f7f7f7f;
const int jzm=233;
const int mo=998244353;
const double Pi=acos(-1.0);
typedef pair<int,int> pii;
const double PI=acos(-1.0);
template<typename _T>
_T Fabs(_T x){return x<0?-x:x;}
template<typename _T>
void read(_T &x){
	_T f=1;x=0;char s=getchar();
	while(s>'9'||s<'0'){if(s=='-')f=-1;s=getchar();}
	while('0'<=s&&s<='9'){x=(x<<3)+(x<<1)+(s^48);s=getchar();}
	x*=f;
}
LL n,ans;
int main(){
	read(n);
	if(n>=1000LL)ans+=(n-999LL);
	if(n>=1000000LL)ans+=(n-999999LL);
	if(n>=1000000000LL)ans+=(n-999999999LL);
	if(n>=1000000000000LL)ans+=(n-999999999999LL);
	if(n>=1000000000000000LL)ans+=(n-999999999999999LL);
	printf("%lld\n",ans);
	return 0;
}
// C -Comma
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(int)(n); ++i)
#define rep2(i, s, n) for(int i=(s); i<(int)(n); ++i)
using namespace std;
using ll = long long;
using ull = unsigned long long;

int main(){
    string N;
    cin >> N;
    ull len = 0;
    ull s3 = 999999-1000+1, s6 = (999999999-1000000+1)*2;
    ull s9 = (999999999999-1000000000+1)*3;
    ull s12 = (999999999999999-1000000000000+1)*4; 
    ll v = stoll(N);
    if(N.size() >= 4 && N.size() <= 6){
        len = v-1000+1;
    }else if(N.size() >= 7 && N.size() <= 9){
        len = (v-1000000+1)*2+s3;
    }else if(N.size() >= 10 && N.size() <= 12){
        len = (v-1000000000+1)*3+s3+s6;
    }else if(N.size() >= 13 && N.size() <= 15){
        len = (v-1000000000000+1)*4+s3+s6+s9;
    }else if(N.size() == 16){
        len = 5+s3+s6+s9+s12;
    }
    cout << len << endl;
    return 0;
}