#include <bits/stdc++.h>
using namespace std;
long long dem(int i, long long n)
{
	freopen ("CHARNUM.inp", "r", stdin);
	freopen ("CHARNUM.out", "w", stdout);
	if (n>=pow(10,i+1)) return 9*pow(10,i)*(i+1) + dem(i+1,n);
	else return (n- pow(10,i) +1)*(i+1);
}
int main ()
{
	long long n;
	cin >> n;
	cout << dem (0,n);
}
