https://codeforces.com/contest/552/problem/B
#include <bits/stdc++.h>
using namespace std;
int a[1005];
int l;
typedef long long ll;
int main()
{
int n;
cin >> n;
ll t = 1;
ll res = 0;
while (n-t>=0){
res += n - t + 1; //每位出现的数字个数
t *= 10;
}
cout << res << endl;
return 0;
}