#include <fstream>
#include <cmath>

using namespace std;

ifstream input("CHARNUM.inp");
ofstream output("CHARNUM.out");
long long n;
long long res = 0;
int i = 0;
string a;
int main()
{
	input >> n;
	i = log10(n) + 1;
	res += ((i - 1) * 9 * pow(10, i - 2)) + (i * (n - pow(10, i - 1) + 1));
	output << res;
	input.close();
	output.close();
	return 0;
}