#include <fstream>

using namespace std;

ifstream input("CHARNUM.inp");
ofstream output("CHARNUM.out");

long long n;
long long res = 0;

int main()
{
	input >> n;
	for (long long i = 1; i <= n; i *= 10)
	{
		res += (n - i + 1);
	}
	output << res;
	return 0;
}