#include <bits/stdc++.h>
using namespace std;
long long pw(long long n){
long long i=1;
for (long j=0 ; j<n ; j++) i*=10;
return i;
}
int main() {
long long int n,m,sum=0,i=10,z;
cin>>n;
m=n;
while(i!=0)
{
n=m-pw(i);
if(n>=0)
{
m=m-n-1;
//cout<<m;
sum=sum+(n+1)*(i+1);
}
i--;
}
cout<<sum+m<<endl;
// your code goes here
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiBsb25nIGxvbmcgcHcobG9uZyBsb25nIG4pewpsb25nIGxvbmcgaT0xOwpmb3IgKGxvbmcgaj0wIDsgajxuIDsgaisrKSAgaSo9MTA7CnJldHVybiBpOwoKfQppbnQgbWFpbigpIHsKICAgIGxvbmcgbG9uZyBpbnQgbixtLHN1bT0wLGk9MTAsejsKICAgIGNpbj4+bjsKICAgIG09bjsKIAogICAgd2hpbGUoaSE9MCkKICAgIHsKICAgICAgICBuPW0tcHcoaSk7CiAgICAgICAgaWYobj49MCkKICAgICAgICB7CiAgICAgICAgbT1tLW4tMTsKICAgICAgICAvL2NvdXQ8PG07CiAgICAgICAgc3VtPXN1bSsobisxKSooaSsxKTsKICAgICAgICB9CiAgICAgICAgaS0tOwogICAgfQogCiAgICBjb3V0PDxzdW0rbTw8ZW5kbDsKIAovLyB5b3VyIGNvZGUgZ29lcyBoZXJlCiAgICByZXR1cm4gMDsKfQ==