#include <bits/stdc++.h>
using namespace std;
int main() {
long long int n,m,sum=0,i=10,z;
cin>>n;
m=n;
while(i!=0)
{
n=m- (long long int)pow(10,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+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKaW50IG1haW4oKSB7CiAgICBsb25nIGxvbmcgaW50IG4sbSxzdW09MCxpPTEwLHo7CiAgICBjaW4+Pm47CiAgICBtPW47CiAKICAgIHdoaWxlKGkhPTApCiAgICB7CiAgICAgICAgbj1tLSAobG9uZyBsb25nIGludClwb3coMTAsaSk7CiAgICAgICAgaWYobj49MCkKICAgICAgICB7CiAgICAgICAgbT1tLW4tMTsKICAgICAgICAvL2NvdXQ8PG07CiAgICAgICAgc3VtPXN1bSsobisxKSooaSsxKTsKICAgICAgICB9CiAgICAgICAgaS0tOwogICAgfQogCiAgICBjb3V0PDxzdW0rbTw8ZW5kbDsKIAovLyB5b3VyIGNvZGUgZ29lcyBoZXJlCiAgICByZXR1cm4gMDsKfQ==