#include<iostream>
#include<cstdio>
#include<vector>
#include<cmath>
#include<climits>
using namespace std;
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;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGNzdGRpbz4KI2luY2x1ZGU8dmVjdG9yPgojaW5jbHVkZTxjbWF0aD4KI2luY2x1ZGU8Y2xpbWl0cz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4oKXsKCglsb25nIGxvbmcgbjsKCWNpbj4+bjsKCWxvbmcgbG9uZyB4PW47Cglsb25nIGxvbmcgY291bnQ9MDsKCXdoaWxlKHg+MCl7CgkKCQljb3VudCsrOwoJCXgvPTEwOwoJfQoJbG9uZyBsb25nIGFucz0wOwoJYW5zPShuLXBvdygxMCxjb3VudC0xKSsxKSpjb3VudDsKCWZvcihsb25nIGxvbmcgaT1jb3VudC0yO2k+PTA7aS0tKXsKCQoJCWFucys9OSpwb3coMTAsaSkqKGkrMSk7Cgl9Cgljb3V0PDxhbnM8PGVuZGw7Cn0=