#include<iostream>
#include<cstdio>
#include<vector>
#include<cmath>
#include<climits>
using namespace std;
int pow(int a, int b){
int ret=1;
for (int i=0;i<b;i++)
ret*=a;
return ret;
}
int main(){
long long n;
cin>>n;
long long x=n;
long long count=0;
while(x>0){
count++;
x/=10;
}
long long ans=0;
ans=(n-pow(10,count-1)+1)*count;
for(long long i=count-2;i>=0;i--){
ans+=9*pow(10,i)*(i+1);
}
cout<<ans<<endl;
cin.get();
cin.get();
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGNzdGRpbz4KI2luY2x1ZGU8dmVjdG9yPgojaW5jbHVkZTxjbWF0aD4KI2luY2x1ZGU8Y2xpbWl0cz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBwb3coaW50IGEsIGludCBiKXsKICAgIGludCByZXQ9MTsKICAgIGZvciAoaW50IGk9MDtpPGI7aSsrKQogICAgcmV0Kj1hOwogICByZXR1cm4gcmV0OyAgIAp9CgppbnQgbWFpbigpewogCglsb25nIGxvbmcgbjsKCWNpbj4+bjsKCWxvbmcgbG9uZyB4PW47Cglsb25nIGxvbmcgY291bnQ9MDsKCXdoaWxlKHg+MCl7CiAKCQljb3VudCsrOwoJCXgvPTEwOwoJfQoJbG9uZyBsb25nIGFucz0wOwoJYW5zPShuLXBvdygxMCxjb3VudC0xKSsxKSpjb3VudDsKCWZvcihsb25nIGxvbmcgaT1jb3VudC0yO2k+PTA7aS0tKXsKIAoJCWFucys9OSpwb3coMTAsaSkqKGkrMSk7Cgl9Cgljb3V0PDxhbnM8PGVuZGw7CgljaW4uZ2V0KCk7CgljaW4uZ2V0KCk7CglyZXR1cm4gMDsKfQ==