#include <bits/stdc++.h>
using namespace std;
#define lli long long int
const int MAX=1e9+7;
#define EPS 1e-9
lli solve(lli n){
lli sz=log10(n)+EPS+1;
if(sz==1)return n;
lli ans=9+(n-pow(10,sz-1)+EPS+1)*sz;
for(int i=sz-1;i>1;i--){
ans+=9*i*(pow(10,i-1)+EPS);
}
return ans;
}
int main()
{
lli n;
cin>>n;
cout<<solve(n)<<"\n";
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+ICAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsgIAojZGVmaW5lIGxsaSBsb25nIGxvbmcgaW50CmNvbnN0IGludCBNQVg9MWU5Kzc7CiNkZWZpbmUgRVBTIDFlLTkKbGxpIHNvbHZlKGxsaSBuKXsKCWxsaSBzej1sb2cxMChuKStFUFMrMTsKCWlmKHN6PT0xKXJldHVybiBuOwoJbGxpIGFucz05KyhuLXBvdygxMCxzei0xKStFUFMrMSkqc3o7Cglmb3IoaW50IGk9c3otMTtpPjE7aS0tKXsKCQlhbnMrPTkqaSoocG93KDEwLGktMSkrRVBTKTsKCX0KCXJldHVybiBhbnM7Cn0KaW50IG1haW4oKSAgCnsgIAogIAoJCWxsaSBuOwoJCWNpbj4+bjsKICAgIAljb3V0PDxzb2x2ZShuKTw8IlxuIjsKICAJcmV0dXJuIDA7ICAKfSAgCg==