Vanya got an important task — he should enumerate books in the library and label each book with its number. Each of the n books should be assigned with a number from 1 to n. Naturally, distinct books should be assigned distinct numbers.

Vanya wants to know how many digits he will have to write down as he labels the books.


-----Input-----

The first line contains integer n (1 ≤ n ≤ 10^9) — the number of books in the library.


-----Output-----

Print the number of digits needed to number all the books.


-----Examples-----
Input
13

Output
17

Input
4

Output
4



-----Note-----

Note to the first test. The books get numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, which totals to 17 digits.

Note to the second sample. The books get numbers 1, 2, 3, 4, which totals to 4 digits.

Difficulty: EASY

Solutions:
num = int(input())
total = 0
for x in range(1, 11):
	if x == len(str(num)):
		total += (num - 10 ** (x - 1) + 1) * x
	elif x < len(str(num)):
		total += 9 * 10 ** (x - 1) * x
	else:
		break
print(total)


n = int(input())
s = str(n)
if len(s) == 1:
	print(n)
else:
	t = '9' * (len(s) - 1)
	t = int(t)
	c = 0
	c += len(s) * (n - t)
	n -= n - t
	s = str(n)
	p = 9
	for i in range(1, len(s) + 1):
		c += p * i
		p *= 10
	print(c)


n = input()
k = len(n)
print(n if k == 1 else sum((9 * (i + 1) * 10 ** i for i in range(k - 1))) + k * (int(n) - int('9' * (k - 1))))


a = int(input())
digits = 0
rem = 0
for i in range(len(str(a)) - 1):
	f = int(str(9) * (i + 1)) - rem
	digits += f * (i + 1)
	rem += f
print(digits + (a - rem) * len(str(a)))


n = input()
t = len(n) - 1
x = 0
for i in range(t):
	x += (i + 1) * 9 * 10 ** i
x += (int(n) - 10 ** t + 1) * (t + 1)
print(x)


n = int(input())
a = 0
r = 1
while n - r >= 0:
	a += n - r + 1
	r *= 10
print(a)


n = int(input())
ans = 0
for i in range(1, 11):
	if i == len(str(n)):
		ans += (n - 10 ** (i - 1) + 1) * i
	elif i < len(str(n)):
		ans += 9 * 10 ** (i - 1) * i
	else:
		break
print(ans)


import math
sum = 0
n = int(input())
for i in range(1, 11):
	sum += i * max(min(9 * math.pow(10, i - 1), n - math.pow(10, i - 1) + 1), 0)
print(int(sum))


import math
n = int(input())
amount = 0
m = n
while m >= 1:
	amount += 1
	m /= 10
ans = 0
for ii in range(1, amount):
	ans += 9 * math.pow(10, ii - 1) * ii
ans += (n - math.pow(10, amount - 1) + 1) * amount
print(int(ans))


import os
import sys
from io import BytesIO, IOBase

def solution(n):
	(i, x) = (1, 0)
	(factor, res) = (1, 0)
	while x + 9 * i < n:
		res += 9 * i * factor
		x += 9 * i
		i *= 10
		factor += 1
	diff = n - x
	res += len(str(n)) * diff
	write(res)

def main():
	n = r_int()
	solution(n)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


import math
c = int(input())
a = math.ceil(math.log10(c))
s = 0
for i in range(1, a):
	s = s + i * (9 * 10 ** (i - 1))
s = s + (c - 10 ** (a - 1) + 1) * a
if c == 10 ** a:
	s = s + 1
print(int(s))


n = int(input())
if n == 1:
	print(1)
else:
	d = 0
	temp = 10
	c = 1
	nos = 9
	while temp < n:
		d = d + nos * c
		temp *= 10
		c += 1
		nos *= 10
	temp = temp // 10
	t = n - temp + 1
	d = d + t * len(str(temp))
	if str(n).count('0') == len(str(n)) - 1 and str(n).count('1') == 1:
		d += 1
	print(int(d))


n = int(input())
res = 0
lower = 1
upper = 9
digit = 1
while n >= lower:
	if n <= upper:
		res += digit * (n - lower + 1)
	else:
		res += digit * (upper - lower + 1)
	lower *= 10
	upper = (upper + 1) * 10 - 1
	digit += 1
print(res)


def solve():
	book_num = int(input())
	cur_digit_min = 1
	cur_digit_max = 9
	cur_digit = 1
	result = 0
	while True:
		if book_num > cur_digit_max:
			result += (cur_digit_max - cur_digit_min + 1) * cur_digit
			cur_digit += 1
			cur_digit_min *= 10
			cur_digit_max = cur_digit_max * 10 + 9
		else:
			result += (book_num - cur_digit_min + 1) * cur_digit
			break
	print(result)
solve()


n = input()
print(sum((int(n) - 10 ** i + 1 for i in range(len(n)))))


n = int(input())
ans = 0
a = [9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999, 9999999999, 99999999999]
for i in range(len(str(n)) - 1):
	if i != 0:
		ans += (a[i] - a[i - 1]) * (i + 1)
	else:
		ans += a[i] * (i + 1)
ans += (1 + n - int(str(1) + str(0) * (len(str(n)) - 1))) * len(str(n))
print(ans)


n = int(input())
if n > 9:
	p = 9
	d = 1
	ans = 0
	while n > 0:
		if p < n:
			ans += p * d
		else:
			ans += n * d
		d += 1
		n -= p
		p = p * 10
	print(ans)
else:
	print(n)


n = int(input())
mult = len(str(n))
curr = pow(10, mult - 1)
digits = 0
while n > 0:
	rest = n - (curr - 1)
	digits += rest * mult
	mult -= 1
	curr /= 10
	n -= rest
print(int(digits))


inp = int(input())
ans = 0
var = 9
ans = 0
num = 1
while inp > 0:
	ans += min(inp, var) * num
	inp -= var
	var *= 10
	num += 1
print(ans)


__author__ = 'victormion'
n = int(input())
digits = 1
x = 1
y = 9
sum = 0
while n > y:
	sum += (y - x + 1) * digits
	digits += 1
	x *= 10
	y += 9 * x
sum += (n - x + 1) * digits
print(sum)


import math
n = int(input())
k = math.log10(n)
k = int(k) + 1
m = (n - 10 ** (k - 1) + 1) * k

def po(n):
	return (10 ** n * (n * 10 - n - 1) + 1) // 81
print(m + 9 * po(k - 1))


x = int(input())
ptp = ''
p = len(str(x)) - 1
t = '1' + '0' * p
an = 0
while x > 0:
	at = (int(t) - x) * -1
	an += ((int(t) - x) * -1 + 1) * len(str(x))
	x -= at + 1
	t = '1' + '0' * (len(str(x)) - 1)
print(an)


s = input()
t = len(s)
k = int(s)
m = 0
while t >= 0:
	m = m + int(t * (k - 10 ** (t - 1) + 1))
	k = 10 ** (t - 1) - 1
	t -= 1
print(m)


n = int(input())
if n < 10:
	print(n)
elif n < 100:
	sum1 = 9
	sum1 += (n - 9) * 2
	print(sum1)
elif n < 1000:
	sum1 = 9 + 90 * 2
	sum1 += (n - 99) * 3
	print(sum1)
elif n < 10000:
	sum1 = 9 + 90 * 2 + 900 * 3
	sum1 += (n - 999) * 4
	print(sum1)
elif n < 100000:
	sum1 = 9 + 90 * 2 + 900 * 3 + 9000 * 4
	sum1 += (n - 9999) * 5
	print(sum1)
elif n < 1000000:
	sum1 = 9 + 90 * 2 + 900 * 3 + 9000 * 4 + 90000 * 5
	sum1 += (n - 99999) * 6
	print(sum1)
elif n < 10000000:
	sum1 = 9 + 90 * 2 + 900 * 3 + 9000 * 4 + 90000 * 5 + 900000 * 6
	sum1 += (n - 999999) * 7
	print(sum1)
elif n < 100000000:
	sum1 = 9 + 90 * 2 + 900 * 3 + 9000 * 4 + 90000 * 5 + 900000 * 6 + 9000000 * 7
	sum1 += (n - 9999999) * 8
	print(sum1)
elif n < 1000000000:
	sum1 = 9 + 90 * 2 + 900 * 3 + 9000 * 4 + 90000 * 5 + 900000 * 6 + 9000000 * 7 + 90000000 * 8
	sum1 += (n - 99999999) * 9
	print(sum1)
else:
	sum1 = 9 + 90 * 2 + 900 * 3 + 9000 * 4 + 90000 * 5 + 900000 * 6 + 9000000 * 7 + 90000000 * 8 + 900000000 * 9 + 10
	print(sum1)


n = int(input())
if n < 10:
	print(n)
else:
	s = str(n)
	p = len(s) - 1
	count = 0
	while p > 0:
		s1 = ''
		q = p
		while q > 0:
			s1 = s1 + '9'
			q -= 1
		r = int(s1)
		count = count + (p + 1) * (n - r)
		n = r
		p -= 1
	print(count + 9)


s = input()
print((int(s) + 1) * len(s) - int('1' * len(s)))


from sys import stdin
n = int(stdin.readline())
l = len(str(n))
s = sum(((x + 1) * 9 * 10 ** x for x in range(l - 1)))
s += (n - 10 ** (l - 1) + 1) * l
print(s)


n = input()
m = int(n)
k = 10
s = 1
answ = 0
while True:
	if s * 10 > m:
		break
	s *= 10
answ += (m - s) * len(n) + len(n)
v = 0
cnt1 = 1
cnt2 = 1
while cnt2 != s:
	v += 9 * cnt1 * cnt2
	cnt1 += 1
	cnt2 *= 10
answ += v
print(answ)


nstr = input()
n = int(nstr)
ans = 0
for i in range(1, len(nstr) + 1):
	if i < len(nstr):
		ans += 9 * 10 ** (i - 1) * i
	else:
		ans += (n - 10 ** (i - 1) + 1) * i
print(ans)


from collections import deque
num = int(input())
pow = 9
cnt = 1
ans = 0
while num > 0:
	ans += min(num, pow) * cnt
	cnt += 1
	num -= pow
	pow *= 10
print(ans)


s = input()
length = len(s)
count = (int(s) - 10 ** (length - 1) + 1) * length
for i in range(length - 1, 0, -1):
	count += 9 * 10 ** (i - 1) * i
print(count)


def one(l):
	n = 0
	while l:
		n = n * 10 + 1
		l -= 1
	return n
n = input()
print(len(n) * (int(n) + 1) - one(len(n)))


n = input()
result = 0
y = -1
for i in range(1, len(n) + 1):
	x = '9' * i
	if int(x) < int(n):
		result += (int(x) - y) * i
		y = int(x)
	else:
		result += (int(n) - y) * i
print(result - 1)


a = input()
p = len(a)
q = p * (int(a) + 1) - int('1' * p)
print(q)


n = int(input())
if len(str(n)) == 1:
	print(n)
else:
	print((n + 1) * len(str(n)) - int(str(1) * len(str(n))))


a = int(input())
l = len(str(a)) - 1
print((a - 10 ** l + 1) * (l + 1) + 8 * 10 ** l // 9 + (l - 1) * 10 ** l + 1)


import math
ans = 0
k = 1
i = 9
n = int(input())
while n >= i:
	n -= i
	ans += i * k
	k += 1
	i = i * 10
ans += n * k
print(ans)


n = input()
t = len(n) - 1
ans = 0
i = 1
while i <= t:
	ans = ans + i * 9 * pow(10, i - 1)
	i = i + 1
if t > 0:
	k = int(n) - int('9' * t)
else:
	k = int(n)
print(ans + k * (t + 1))


a = input()
b = len(a)
print(int(a) * b + b - int('1' * b))


n = str(input())
a = len(n)
s = 0
k = '9'
if int(n) <= 9:
	print(n)
else:
	s += 9
	for i in range(2, a):
		s += (int(i * k) - 10 ** (i - 1) + 1) * i
	s += (int(n) - 10 ** (a - 1) + 1) * a
	print(s)


n = int(input())
(tmp, p, ans) = (9, 1, 0)
while n - tmp > 0:
	ans += tmp * p
	n -= tmp
	tmp = 9 * 10 ** p
	p += 1
ans += n * p
print(ans)


def solve():
	n = int(input())
	width = 0
	for width in range(100):
		if n // pow(10, width) == 0:
			break
	total = 0
	for i in range(width - 1):
		delta = (i + 1) * (pow(10, i + 1) - pow(10, i))
		total += delta
	delta = width * (n - pow(10, width - 1) + 1)
	total += delta
	print(total)
solve()


z = input
mod = 10 ** 9 + 7
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0:
			return 0
	return 1
z = input
mod = 10 ** 9 + 7
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0:
			return 0
	return 1
n = int(z())
t = int(log10(n))
for i in range(1, n + 1):
	if n < 10 ** i:
		t = i * (n + 1) - int('1' * i)
		print(t)
		exit()


n = int(input())
res = 0
(lo, hi) = (1, 10)
digs = 1
while lo <= n:
	res += digs * (min(hi, n + 1) - lo)
	lo *= 10
	hi *= 10
	digs += 1
print(res)


n = int(input())
p = 0
sm = 0
while n > p:
	sm = sm + (n - p)
	p = p * 10 + 9
print(sm)


n = int(input())
s = str(n)
if len(s) == 1:
	print(n)
if len(s) == 2:
	print(n + (n - 9))
if len(s) == 3:
	print(n + 90 + (n - 99) * 2)
if len(s) == 4:
	print(n + 2 * 900 + 90 + (n - 999) * 3)
if len(s) == 5:
	print(n + 3 * 9000 + 2 * 900 + 90 + (n - 9999) * 4)
if len(s) == 6:
	print(n + 4 * 90000 + 3 * 9000 + 2 * 900 + 90 + (n - 99999) * 5)
if len(s) == 7:
	print(n + 5 * 900000 + 4 * 90000 + 3 * 9000 + 2 * 900 + 90 + (n - 999999) * 6)
if len(s) == 8:
	print(n + 6 * 9000000 + 5 * 900000 + 4 * 90000 + 3 * 9000 + 2 * 900 + 90 + (n - 9999999) * 7)
if len(s) == 9:
	print(n + 7 * 90000000 + 6 * 9000000 + 5 * 900000 + 4 * 90000 + 3 * 9000 + 2 * 900 + 90 + (n - 99999999) * 8)
if len(s) == 10:
	print(n + 8 * 900000000 + 7 * 90000000 + 6 * 9000000 + 5 * 900000 + 4 * 90000 + 3 * 9000 + 2 * 900 + 90 + (n - 999999999) * 9)


import math

class CodeforcesTask552BSolution:

	def __init__(self):
		self.result = ''
		self.n = 0

	def read_input(self):
		self.n = int(input())

	def process_task(self):
		z = 0
		for k in range(int(math.floor(math.log10(self.n)))):
			z += 9 * 10 ** k * (k + 1)
		z += (1 + self.n - 10 ** int(math.floor(math.log10(self.n)))) * len(str(self.n))
		self.result = str(z)

	def get_result(self):
		return self.result
Solution = CodeforcesTask552BSolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


ns = input()
n = int(ns)
ans = 0
for i in range(len(ns) - 1):
	ans += 9 * 10 ** i * (i + 1)
m = n - 10 ** (len(ns) - 1) + 1
ans += m * len(ns)
print(ans)


n = input()
n = int(n)
ans = 0
prev = 1
for i in range(1, 11):
	if n >= 10 ** i:
		ans += (10 ** i - prev) * i
		prev = 10 ** i
	elif n < 10:
		ans = n
		break
	else:
		ans += (n - prev + 1) * i
		break
print(ans)


n = int(input())
if n < 10:
	print(n)
else:
	nearest9 = (len(str(n)) - 1) * '9'
	res1 = (n - int(nearest9)) * len(str(n))
	res = ''
	for i in range(1, len(nearest9) + 1):
		res = str(i) + res
	print(9 * int(res) + res1)


n = int(input())
d = 1
l = 1
r = 10
sum = 0
while r <= n:
	sum += (r - l) * d
	d += 1
	l = r
	r *= 10
sum += (n - l + 1) * d
print(sum)


n = int(input())
t = 0
c = 9
i = 1
while n > 0:
	m = min(c, n)
	t += i * m
	n -= m
	i += 1
	c *= 10
print(t)


p = [0] * 13
for i in range(13):
	p[i] = 10 ** i
n = int(input())
ans = 0
for i in range(11):
	if n < p[i + 1]:
		ans += (n - p[i] + 1) * (i + 1)
		break
	else:
		ans += 9 * (i + 1) * p[i]
print(ans)


count = 0
n = int(input())
i = 1
while i <= 10:
	if n < pow(10, i):
		count = count + i * (n - pow(10, i - 1) + 1)
		break
	else:
		count = count + i * (pow(10, i) - pow(10, i - 1))
	i = i + 1
print(count)


def codeforces():
	n = int(input())
	ln = len(str(n))
	sm = 0
	for i in range(ln):
		sm += 10 ** i
	return ln * (n + 1) - sm
print(codeforces())


n = int(input())
if n < 10:
	print(n)
else:
	ans = int(len(str(n)) - 1)
	ans0 = int(len(str(n)))
	ans1 = (n % 10 ** ans + 1) * (ans + 1)
	ans2 = (n // 10 ** ans - 1) * ans0 * 10 ** ans
	j = 1
	h = 9
	ans3 = 0
	for i in range(len(str(n)) - 1):
		ans3 += j * h
		h *= 10
		j += 1
	print(ans1 + ans2 + ans3)


from math import ceil
from math import floor

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def find_least_diff(n):
	A = 2 * (pow(2, n / 2 - 1) - 1)
	B = -pow(2, n / 2)
	return int(abs(B - A))

def find_ways(n):
	return (n - 1) // 2

def count_digits(n):
	m = 9
	count = n
	while True:
		if n >= m:
			count += n - m
		else:
			break
		m = str(m)
		m += '9'
		m = int(m)
	return count

def min_string(n, k, text):
	text = sorted(text)
	if text[0] == text[k - 1]:
		print(''.join((text[i] for i in range(k - 1, n))))
	else:
		print(text[k - 1])

def get_board(n, m, mat):
	for i in range(n):
		for j in range(m):
			print(i, j)
			if mat[i][j] == '.':
				if (j > 0 and mat[i][j - 1] != 'B') and (i > 0 and mat[i - 1][j] != 'B'):
					mat[i][j] = 'B'
				else:
					mat[i][j] = 'W'
	for i in range(n):
		for j in range(m):
			print(mat[i][j])
t = 1
while t:
	t = t - 1
	count = 0
	px = []
	py = []
	n = int(input())
	print(count_digits(n))


n = int(input())
size = len(str(n))
ar = [0, 9, 90]
s = 90
ans = 0
cum = 0
for i in range(10):
	s *= 10
	ar.append(s)
for i in range(size - 1):
	ans += ar[i + 1] * (i + 1)
	cum += ar[i + 1]
ans += (n - cum) * size
print(ans)


def f(m, n):
	if len(str(m)) < len(str(n)):
		return f(m, int('9' * (len(str(n)) - 1))) + f(int('9' * (len(str(n)) - 1)) + 1, n)
	else:
		return len(str(n)) * (n - m + 1)
n = int(input())
m = 1
print(f(1, n))


N = int(input())
i = 0
summa = 0
while N >= 9 * 10 ** i:
	summa += 9 * 10 ** i * (i + 1)
	N -= 9 * 10 ** i
	i += 1
summa += (i + 1) * N
print(summa)


n = int(input())
count = 9
s = 0
while n > 0:
	if n > count:
		s += count * len(str(count))
	else:
		s += n * len(str(count))
	n -= count
	count *= 10
print(s)


n = int(input())
result = 0
curr = 1
curr_exp = 1
for i in range(len(str(n)) - 1):
	numbers = curr_exp * 9
	result += curr * numbers
	curr_exp *= 10
	curr += 1
result += curr * (n - curr_exp + 1)
print(result)


import math
n = int(input())
total = 0
x = 1
length = 1
while x <= n:
	total += 9 * x * length
	x *= 10
	length += 1
total -= (x - 1 - n) * (length - 1)
print(total)


num = input()
ln = len(num)
num = int(num)
ans = 0
gen = (10 ** x for x in range(1, 11))
for i in gen:
	if num >= i:
		ans += 9 * i // 10 * (len(str(i)) - 1)
	else:
		ans += (num - i // 10 + 1) * (len(str(i)) - 1)
		break
print(ans)


n = int(input())
i = 1
s = 0
while n - 9 * 10 ** (i - 1) >= 0:
	s += i * (9 * 10 ** (i - 1))
	n -= 9 * 10 ** (i - 1)
	i += 1
if n == 0:
	print(s)
else:
	print(s + i * n)


def books(n):
	(result, current) = (n, 9)
	while current < n:
		result += n - current
		current = 10 * current + 9
	return result
print(books(int(input())))


n = input()
m = int(n)
digit = 0
for i in range(len(n)):
	if m > 9 * 10 ** i:
		digit += (i + 1) * 9 * 10 ** i
		m -= 9 * 10 ** i
	else:
		digit += (i + 1) * m
print(digit)


n = int(input())
l = 1
t = 10
count = 0
while t - 1 < n:
	count += (t - t // 10) * l
	t *= 10
	l += 1
count += (n - t // 10 + 1) * l
print(count)


n = input()
b = int(n)
if len(n) > 1:
	z = (b - int('9' * (len(n) - 1))) * len(n)
	w = int('9' * (len(n) - 1)) * (len(n) - 1)
	for i in range(1, len(n) - 1):
		q = '9' * i
		w -= int(q)
	print(z + w)
else:
	print(n)


n = int(input())

def f(n):
	l = len(str(n))
	l1 = l * (n - (10 ** (l - 1) - 1))
	s = 0
	for i in range(1, l):
		s = s + i * (9 * 10 ** (i - 1))
	return s + l1
print(f(n))


n = int(input())
ans = 0
i = 0
while n > 0:
	a = min(n * (i + 1), 9 * 10 ** i * (i + 1))
	ans += a
	n = n - a // (i + 1)
	i += 1
print(ans)


n = int(input())
total = 0
if n < 10:
	print(n)
	return
total += 9
if n < 100:
	total += (n - 9) * 2
	print(total)
	return
total += 90 * 2
if n < 1000:
	total += (n - 99) * 3
	print(total)
	return
total += 900 * 3
if n < 10000:
	total += (n - 999) * 4
	print(total)
	return
total += 9000 * 4
if n < 100000:
	total += (n - 9999) * 5
	print(total)
	return
total += 90000 * 5
if n < 1000000:
	total += (n - 99999) * 6
	print(total)
	return
total += 900000 * 6
if n < 10000000:
	total += (n - 999999) * 7
	print(total)
	return
total += 9000000 * 7
if n < 100000000:
	total += (n - 9999999) * 8
	print(total)
	return
total += 90000000 * 8
if n < 1000000000:
	total += (n - 99999999) * 9
	print(total)
	return
total += 900000000 * 9
if n < 10000000000:
	total += (n - 999999999) * 10
	print(total)
	return
total += 9000000000 * 10
print(total)


n = int(input())
t = 0
i = 1
a = 9
while n > 0:
	if n <= a:
		t += n * i
		break
	t += a * i
	n = n - a
	a = a * 10
	i = i + 1
print(t)


n = int(input())
d = c = 1
f = 9
res = 0
l = len(str(n))
for i in range(l - 1):
	res += f * c
	f *= 10
	d *= 10
	c += 1
res += (n - d + 1) * c
print(res)


r = [1, 11, 192, 2893, 38894, 488895, 5888896, 68888897, 788888898, 8888888899]
s = [1, 20, 300, 4000, 50000, 600000, 7000000, 80000000, 900000000, 1000000000]
n = input()
a = len(n) - 1
res = r[a] + (int(n[0]) - 1) * s[a]
t = 10
for i in range(1, len(n)):
	kt = int(n[i])
	res += kt * (s[a] // t)
	t *= 10
print(res)


n = int(input())
limits = list()
dp = list()
dp.append(0)
lim = 10
while lim < 1000000000000000:
	dp.append(lim - 1)
	lim *= 10
answer = 0
index = 1
while dp[index] < n:
	number = dp[index] - dp[index - 1]
	answer += number * len(str(dp[index]))
	index += 1
answer += (n - dp[index - 1]) * len(str(dp[index]))
print(answer)


n = input()
size = len(n)
n = int(n)
ans = size * (n + 1)
for i in range(size):
	ans -= 10 ** i
print(ans)


num = int(input())
sum = 0
j = 1
while num >= pow(10, j):
	sum += (pow(10, j) - pow(10, j - 1)) * j
	j += 1
sum += (num - pow(10, j - 1) + 1) * j
print(sum)


s = input()
n = int(s)
ans = 0
pow10 = 1
for i in range(1, len(s)):
	ans += i * pow10 * 9
	pow10 *= 10
ans += (n - pow10 + 1) * len(s)
print(ans)


n = input()
f = len(n) * (int(n) - 10 ** (len(n) - 1) + 1)
for i in range(1, len(n)):
	f += i * (10 ** i - 10 ** (i - 1))
print(f)


n = int(input().strip())
k = '9'
p = 1
j = 0
while n > 0:
	if int(k) < n:
		j += p * int(k)
		n = n - int(k)
		k = k + '0'
	else:
		j += p * n
		n = 0
	p += 1
print(j)


n = int(input())
c = len(str(n))
ans = 0
cmon = 9
for i in range(c - 1):
	ans = ans + cmon * (i + 1)
	cmon *= 10
now = 0
now = '9' * (c - 1)
now = '0' + now
now = n - int(now)
ans = ans + now * c
print(ans)


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True
n = ii()
m = n
ans = i = 0
while m > 9:
	m //= 10
	ans += (i + 1) * 9 * 10 ** i
	i += 1
print(ans + (n - 10 ** i + 1) * (i + 1))


n = int(input())
c = 0
s = 0
x = n
while n != 0:
	n = n // 10
	c = c + 1
if c == 1:
	print(x)
elif c == 2:
	d_2 = (x - 10 + 1) * 2
	s = d_2 + 9
	print(s)
elif c == 3:
	d_2 = (x - 100 + 1) * 3
	s = d_2 + 90 * 2 + 9
	print(s)
elif c == 4:
	d_2 = (x - 1000 + 1) * 4
	s = d_2 + 90 * 2 + 9 + 900 * 3
	print(s)
elif c == 5:
	d_2 = (x - 10000 + 1) * 5
	s = d_2 + 9000 * 4 + 900 * 3 + 90 * 2 + 9
	print(s)
elif c == 6:
	d_2 = (x - 100000 + 1) * 6
	s = d_2 + 90000 * 5 + 9000 * 4 + 900 * 3 + 90 * 2 + 9
	print(s)
elif c == 7:
	d_2 = (x - 1000000 + 1) * 7
	s = d_2 + 900000 * 6 + 90000 * 5 + 9000 * 4 + 900 * 3 + 90 * 2 + 9
	print(s)
elif c == 8:
	d_2 = (x - 10000000 + 1) * 8
	s = d_2 + 9000000 * 7 + 900000 * 6 + 90000 * 5 + 9000 * 4 + 900 * 3 + 90 * 2 + 9
	print(s)
elif c == 9:
	d_2 = (x - 100000000 + 1) * 9
	s = d_2 + 90000000 * 8 + 9000000 * 7 + 900000 * 6 + 90000 * 5 + 9000 * 4 + 900 * 3 + 90 * 2 + 9
	print(s)
elif c == 10:
	d_2 = (x - 1000000000 + 1) * 10
	s = d_2 + 900000000 * 9 + 90000000 * 8 + 9000000 * 7 + 900000 * 6 + 90000 * 5 + 9000 * 4 + 900 * 3 + 90 * 2 + 9
	print(s)


n = int(input())
ans = 0
t = 1
while t <= n:
	ans += n - t + 1
	t *= 10
print(ans)


n = int(input())
i = 1
ans = 0
while n > 10 ** i - 1:
	ans += i * 9 * 10 ** (i - 1)
	i += 1
ans += (n - 10 ** (i - 1) + 1) * i
print(ans)


n = int(input())
j = 10
ans = 0
last = 0
while j - 1 < n:
	ans += len(str(j - 1)) * (j - 1 - last)
	last = j - 1
	j *= 10
ans += len(str(n)) * (n - last)
print(ans)


n = int(input())
ans = 0
for i in range(len(str(n))):
	kek = 9 * 10 ** i
	if n - kek > 0:
		ans += kek * (i + 1)
	else:
		ans += n * (i + 1)
	n -= kek
print(ans)


n = int(input())
l = len(str(n))
upper = 0
for i in range(l):
	upper += 9 * pow(10, i) * (i + 1)
miss = (int('9' * l) - n) * l
print(upper - miss)


n = int(input())
m = len(str(n))
c = 0
for i in range(1, m):
	c += 9 * i * 10 ** (i - 1)
c += (n - 10 ** (m - 1) + 1) * m
print(c)


n = int(input())
s = 0
st = 9
mul = 1
while n > 0:
	if n >= st:
		s += st * mul
		n -= st
		st *= 10
		mul += 1
	else:
		s += mul * n
		n = 0
print(s)


def books(n):
	digs = 0
	for i in range(11):
		if n % 10 ** (i + 1) != n:
			digs += (i + 1) * (10 ** (i + 1) - 10 ** i)
		else:
			digs += (i + 1) * (n + 1 - 10 ** i)
			return digs
print(books(int(input())))


from math import log
n = int(input())
order = len(str(n)) - 1
r = 0
for o in range(order):
	r += 9 * 10 ** o * (o + 1)
r += (n - 10 ** order + 1) * (order + 1)
print(r)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy
from itertools import chain, dropwhile, permutations, combinations
from collections import defaultdict, deque

def VI():
	return list(map(int, input().split()))

def I():
	return int(input())

def LIST(n, m=None):
	return [0] * n if m is None else [[0] * m for i in range(n)]

def ELIST(n):
	return [[] for i in range(n)]

def MI(n=None, m=None):
	if n is None:
		(n, m) = VI()
	arr = LIST(n)
	for i in range(n):
		arr[i] = VI()
	return arr

def MS(n=None, m=None):
	if n is None:
		(n, m) = VI()
	arr = LIST(n)
	for i in range(n):
		arr[i] = input()
	return arr

def MIT(n=None, m=None):
	if n is None:
		(n, m) = VI()
	a = MI(n, m)
	arr = LIST(m, n)
	for (i, l) in enumerate(a):
		for (j, x) in enumerate(l):
			arr[j][i] = x
	return arr

def run(n):
	p = math.floor(math.log10(n))
	(a, b) = divmod(n, 10 ** p)
	ans = sum([(i + 1) * 9 * 10 ** i for i in range(p)])
	used = sum([9 * 10 ** i for i in range(p)])
	ans += (n - used) * (p + 1)
	print(ans)

def main(info=0):
	n = I()
	run(n)
main()


s = input()
size = 1
ans = 0
while len(s) > size:
	ans += (10 ** size - 10 ** (size - 1)) * size
	size += 1
s = int(s) - 10 ** (size - 1) + 1
ans += s * size
print(ans)


import math

def main():
	n = int(input())
	x = int(math.log10(n))
	output = 0
	for i in range(x):
		output += (i + 1) * 9 * 10 ** i
	output += (n - 10 ** x + 1) * (x + 1)
	print(output)
main()


n = int(input())
a = [0] * 13
for i in range(13):
	a[i] = 10 ** i - 1
for i in range(2, 13):
	j = 1
	while j < i:
		a[i] = a[i] - a[j]
		j += 1
count = 0
for i in range(1, 13):
	if n - a[i] > 0:
		count += a[i] * i
		n -= a[i]
	else:
		count += n * i
		break
print(count)


n = int(input())
k = 9
ans = 0
i = 1
j = 9
while j < n:
	ans += k * i
	i += 1
	k *= 10
	j += k
ans += (n + 1 - 10 ** (i - 1)) * i
print(ans)


n = int(input())
if n < 10:
	print(n)
else:
	i = 1
	nd = 0
	while 10 ** i <= n:
		nd += (10 ** i - 10 ** (i - 1)) * i
		i += 1
	nd += (1 + n - 10 ** (i - 1)) * i
	print(nd)


import math
n = int(input())
a = 0
for i in range(0, 10):
	x = 9 * 10 ** i
	if n > x:
		n -= x
		a += x * (i + 1)
	else:
		a += n * (i + 1)
		break
print(a)


n = input()
ans = 0
(x, y, z) = (9, 9, 9)
if len(n) == 1:
	ans = n
else:
	for i in range(len(n)):
		ans += (i + 1) * x
		z = y
		y = z * 10 + 9
		x *= 10
	ans += len(n) * (int(n) - z)
print(ans)


def xxx(n):
	total = 0
	curr = 9
	for i in range(n):
		total += curr * (i + 1)
		curr *= 10
	return total
n = int(input())
l = len(str(n))
a = xxx(l - 1)
b = (n - 10 ** (l - 1) + 1) * l
print(a + b)


n = int(input())
final = n
t = 9
while True:
	if n > t:
		final += n - t
		t = 9 + t * 10
	else:
		break
print(final)


(n, s) = (int(input()), 0)
for b in range(10, -1, -1):
	if n >= 10 ** b:
		s += (b + 1) * (n - 10 ** b + 1)
		n = 10 ** b - 1
print(s)


n = int(input())
s = '9'
while n >= int(s):
	s += '9'
ans = 0
for i in range(len(s)):
	if i == 0:
		ans += n
	else:
		k = '9' * i
		ans += n - int(k)
print(ans)


n = input()
p = len(n)
print((int(n) + 1) * p - int('1' * p))


__author__ = 'KostikBigOne'

def main():
	n = int(input())
	(power, cnt) = (1, 9)
	ans = 0
	length = 1
	while True:
		if n >= 10 * power:
			ans += length * cnt
			cnt *= 10
			power *= 10
			length += 1
		else:
			ans += length * (n - power + 1)
			break
	print(ans)
main()


n = input()
great = '1' + '0' * (len(n) - 1)
(ans, great) = (len(n) * (int(n) - int(great) + 1), int(great) // 10)
for i in range(len(n) - 1, 0, -1):
	ans += i * 9 * great
	great //= 10
print(ans)


n = int(input())
(k, ans) = (0, 0)
while n >= k:
	ans += n - k
	k = k * 10 + 9
print(ans)


n = int(input())
l = len(str(n))
nine = 9
sum = 0
for i in range(1, l):
	sum += nine * i
	nine *= 10
sum += (n - 10 ** (l - 1) + 1) * l
print(sum)


def f(n, nd):
	if nd is 0:
		return 0
	return (n - 10 ** (nd - 1) + 1) * nd + f(10 ** (nd - 1) - 1, nd - 1)
n = int(input())
k = n
nd = 0
while k != 0:
	k = k // 10
	nd += 1
print(f(n, nd))


n = int(input())
suma = 0
if n < 10:
	print(n)
else:
	a = '1'
	b = a + str((len(str(n)) - 1) * '0')
	c = n - int(b)
	suma = suma + len(str(n)) * c + len(str(n))
	d = '9'
	e = len(str(n))
	e = e - 1
	while e >= 1:
		d += '0' * (e - 1)
		f = int(d)
		suma += f * e
		e -= 1
		d = '9'
	print(suma)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def abs(x):
	return x if x >= 0 else -x

def sumelem(x, start, end):
	sum = 0
	for i in range(start, end + 1):
		sum += x[i]
	return sum
for t in range(1):
	n = int(input())
	p = len(str(n))
	ans = p * (n + 1) - int('1' * p)
	print(ans)


def judge_digit(a: int) -> int:
	digit = 1
	while a // 10 != 0:
		a = a // 10
		digit += 1
	return digit

def create(a: int) -> int:
	num = 1
	for i in range(a):
		num *= 10
	return num
number = int(input())
digit = len(str(number))
ans = 0
ans += (number - create(digit - 1) + 1) * digit
digit -= 1
for i in range(digit):
	ans += (digit - i) * 9 * create(digit - 1 - i)
print(ans)


x = input()
if int(x) < 10:
	print(x)
else:
	d = 0
	p = len(x)
	while p > 1:
		d += p * (int(x) - int((p - 1) * '9'))
		x = int((p - 1) * '9')
		p -= 1
	print(d + 9)


n = int(input())
x = 10
res = 0
i = 1
while n // x > 0:
	res += (x - x / 10) * i
	i += 1
	x *= 10
res += (n - int(x / 10) + 1) * i
print(int(res))


import math
n = int(input())
p = 1
while True:
	if n < pow(10, p):
		break
	p += 1
first_term = p * (n + 1)
s = 0
for i in range(p):
	s += pow(10, i)
print(first_term - s)


import math
import sys
n = int(input())
s = str(n)
l = len(s)
k = 1
ans = 0
for i in range(0, l - 1):
	ans += 9 * k * (i + 1)
	k *= 10
m = n - k
ans += (m + 1) * l
if l == 1:
	ans = n
print(ans)


n = int(input())
r = 1
v = 1
col = 0
while v * 10 < n:
	col += r * (v * 9)
	r += 1
	v *= 10
w = n - v + 1
if n == v * 10:
	print(col + w * r + 1)
else:
	print(col + w * r)


n = int(input().strip())
length = len(str(n)) - 1
temp = n - (10 ** length - 1)
total = (length + 1) * temp
while length:
	total += 9 * length * 10 ** (length - 1)
	length -= 1
print(total)


n = int(input())
s = 0
t = 9
t1 = 10
i = 1
while t1 - 1 < n:
	s += i * t
	i += 1
	t = t * 10
	t1 = t1 * 10
if t1 == n:
	s += i
else:
	z = int(max('0', '9' * (i - 1)))
	s += i * (n - z)
print(s)


n = int(input())
aux = 9
out = 0
while n > aux:
	out += len(str(aux)) * aux
	n -= aux
	aux *= 10
out += len(str(aux)) * n
print(out)


n = input()
tamanho = len(n)
ans = 0
while tamanho > 0:
	base10 = 10 ** (tamanho - 1)
	n = int(n)
	menos = n - base10 + 1
	ans += menos * tamanho
	n -= menos
	tamanho -= 1
print(ans)


n = input()
k = int(n)
ans = 0
t = 0
d = 9
c = 1
while True:
	if k > d:
		ans += c * (d - t)
		c += 1
		t = d
		d = d * 10 + 9
	else:
		ans += (k - t) * c
		break
print(ans)


s = input()
n = int(s)
m = len(s)
d = int(s[0])
ans = 0
for i in range(m - 1):
	ans += 9 * 10 ** i * (i + 1)
ans += (d - 1) * 10 ** (m - 1) * m
ans += (n - d * 10 ** (m - 1) + 1) * m
print(ans)


n = int(input())
digits = len(str(n))
sum = 0

def getnum(n):
	if n == 0:
		return n
	num = 9
	for i in range(1, n):
		num = num * 10
		num = num + 9
	return num
while True:
	num = getnum(digits - 1)
	sum = sum + (n - num) * digits
	digits = digits - 1
	n = num
	if digits == 0:
		break
print(sum)


n = int(input())
(t, x) = (0, 1)
while 10 ** x <= n:
	t += x * (10 ** x - 10 ** (x - 1))
	x += 1
t += (n - 10 ** (x - 1) + 1) * len(str(n))
print(t)


n = int(input())
a = [9 * 10 ** (i - 1) for i in range(13)]
a[0] = 0
count = 0
for i in range(1, 13):
	if n - a[i] >= 0:
		count += a[i] * i
		n = n - a[i]
	else:
		count += n * i
		break
print(count)


n = int(input())
if n < 10:
	print(n)
else:
	count = 0
	s = str(n)
	if len(s) == 2:
		count += 9 + (n - 9) * 2
	elif len(s) == 3:
		count += 189 + (n - 99) * 3
	elif len(s) == 4:
		count += 2889 + (n - 999) * 4
	elif len(s) == 5:
		count += 38889 + (n - 9999) * 5
	elif len(s) == 6:
		count += 488889 + (n - 99999) * 6
	elif len(s) == 7:
		count += 5888889 + (n - 999999) * 7
	elif len(s) == 8:
		count += 68888889 + (n - 9999999) * 8
	elif len(s) == 9:
		count += 788888889 + (n - 99999999) * 9
	elif len(s) == 10:
		count += 8888888889 + (n - 999999999) * 10
	print(count)


n = input()
o = len(n) - 1
n = int(n)
k = pow(10, o) - 1
a = (n - k) * (o + 1)
while o > 0:
	a += (pow(10, o) - pow(10, o - 1)) * o
	o -= 1
print(a)


n = int(input())
a = str(n)
l = len(a)
if l == 1:
	print(n)
else:
	count = (n - (10 ** (l - 1) - 1)) * l
	if l - 1 != 1:
		for i in range(l - 1, 1, -1):
			count = count + i * (10 ** i - 1 - (10 ** (i - 1) - 1))
	count = count + 9
	print(count)


n = int(input())
d = n
l = 1
while n - int('9' * l) > 0:
	d += n - int('9' * l)
	l += 1
print(d)


v = int(input())
x = len(str(v))
s = 0
if x == 1:
	s = v
else:
	s = 9 + x
	while x != 1:
		s += (v - pow(10, x - 1)) * x
		v = pow(10, x - 1)
		x -= 1
print(s)


n = int(input())
pre = 0
now = 9
ans = 0
t = 0
while now < 10000000000:
	t = t + 1
	if min(n, now) <= pre:
		break
	ans += (min(n, now) - pre) * t
	pre = now
	now = now * 10 + 9
print(ans)


s = input()
n = int(s)
d = 0
if len(s) == 1:
	print(n)
else:
	for i in range(len(s) - 1):
		d += (i + 1) * 9 * 10 ** i
	d += len(s) * (n - 10 ** (len(s) - 1) + 1)
	print(d)


n = int(input())
a = [9, 90 * 2, 900 * 3, 9000 * 4, 90000 * 5, 900000 * 6, 9000000 * 7, 90000000 * 8, 900000000 * 9]
ans = 0
x = len(str(n))
for i in range(x - 1):
	ans += a[i]
y = n - 10 ** (x - 1) + 1
ans += y * x
print(ans)


n = int(input())
k = len(str(n))
l = 0
for i in range(1, k):
	l += 9 * pow(10, i - 1) * i
n -= pow(10, k - 1)
n += 1
l += n * k
print(l)


n = int(input())
ans = 0
k = 1
r = 9
while n > r:
	ans += k * r
	n -= r
	k += 1
	r *= 10
print(ans + k * n)


n = input()
l = len(n)
n = int(n)

def dekh(x):
	if x == 1:
		return 0
	x1 = 0
	for i in range(1, x):
		x1 = x1 + 9 * i * 10 ** (i - 1)
	return x1
ans = dekh(l)
ans = ans + (n - 10 ** (l - 1) + 1) * l
print(ans)


(n, v, p) = (int(input()), 0, 1)
while n >= 10 ** p:
	v += p * 9 * 10 ** (p - 1)
	p += 1
v += (n - 10 ** (p - 1) + 1) * p
print(v)


n = int(input())
leng = n
if leng < 10:
	print(n)
elif leng < 100:
	s = (n - 9) * 2 + 9
	print(s)
elif leng < 1000:
	s = (n - 99) * 3 + 189
	print(s)
elif leng < 10000:
	s = (n - 999) * 4 + 2889
	print(s)
elif leng < 100000:
	s = (n - 9999) * 5 + 38889
	print(s)
elif leng < 1000000:
	s = (n - 99999) * 6 + 488889
	print(s)
elif leng < 10000000:
	s = (n - 999999) * 7 + 5888889
	print(s)
elif leng < 100000000:
	s = (n - 9999999) * 8 + 68888889
	print(s)
elif leng < 1000000000:
	s = (n - 99999999) * 9 + 788888889
	print(s)
elif leng < 10000000000:
	s = (n - 999999999) * 10 + 8888888889
	print(s)


n = int(input())
limit = len(str(n)) - 1
result = 0
cursor = 9
factor = 1
for i in range(limit):
	result += cursor * factor
	n -= cursor
	cursor *= 10
	factor += 1
result += n * factor
print(result)


n = int(input())
answer = 0
answer = min(9, n) * 1
if n >= 10:
	answer += min(90, n - 9) * 2
for cnt_zero in range(3, 11):
	if n < 10 ** (cnt_zero - 1):
		break
	answer += min(9 * 10 ** (cnt_zero - 1), n - 10 ** (cnt_zero - 1) + 1) * cnt_zero
print(answer)


n = input()
size = len(n)
print(int(n) * size + size - int('1' * size))


n = int(input())
sum = 0
p = 1
while True:
	if p > n:
		print(sum)
		break
	sum += n - p + 1
	p *= 10


def digitsof(n):
	lst = []
	while n > 0:
		lst.append(n % 10)
		n //= 10
	return lst

def answer(n):
	lst = digitsof(n)
	cnt = 0
	for i in range(len(lst)):
		cnt += lst[i] * (i + 1) * 10 ** i - (10 ** i - 1)
	return

def answer(n):
	lst = digitsof(n)
	cnt = 0
	if n >= 9:
		cnt += 9
	if n >= 99:
		cnt += 90 * 2
	if n >= 999:
		cnt += 900 * 3
	if n >= 9999:
		cnt += 9000 * 4
	if n >= 99999:
		cnt += 90000 * 5
	if n >= 999999:
		cnt += 900000 * 6
	if n >= 9999999:
		cnt += 9000000 * 7
	if n >= 99999999:
		cnt += 90000000 * 8
	if n >= 999999999:
		cnt += 900000000 * 9
	if n >= 9999999999:
		cnt += 9000000000 * 10
	if min(lst) < 9:
		cnt += (n - 10 ** (len(lst) - 1) + 1) * len(lst)
	return cnt

def main():
	n = int(input())
	print(answer(n))
	return
main()


n = int(input())
y = n
i = 0
res = 0
while y > 0:
	if y > 9 * 10 ** i:
		res += 9 * 10 ** i * (i + 1)
		y -= 9 * 10 ** i
		i += 1
	else:
		res += y * (i + 1)
		y = 0
print(res)


n = int(input())
total_digits = 0
d = 0
c = 1
while n > 0:
	d += 1
	avl = 9 * c
	c = c * 10
	if avl >= n:
		total_digits += n * d
		n = 0
	else:
		n -= avl
		total_digits += avl * d
print(total_digits)


num = int(input())
label = 0
while num > 9:
	dig = len(str(num))
	label = label + dig * (num - 10 ** (dig - 1) + 1)
	num = 10 ** (dig - 1) - 1
label = label + num
print(label)


number = str(input())
digits = len(number)
number = int(number)
res = 0
curr_digit = 1
count = 1
while curr_digit <= digits:
	high = '9' * curr_digit
	lower = '1' + '0' * (curr_digit - 1)
	if number > int(high):
		res += (int(high) - int(lower) + 1) * curr_digit
	else:
		res += (number - int(lower) + 1) * curr_digit
	curr_digit += 1
print(res)


n = int(input().strip())
l = len(str(n))
x = 10 ** (l - 1)
s = (n - x + 1) * l
for i in range(l - 1):
	s += 9 * 10 ** i * (i + 1)
print(s)


N = int(input())
N1 = N
ans = 0
a9 = 9
i = 1
while N > 0:
	ans += min(N, a9) * i
	N -= a9
	a9 *= 10
	i += 1
print(ans)


x = input()
p = [9, 180, 2700, 36000, 450000, 5400000, 63000000, 720000000, 8100000000, 90000000000]
l = len(x)
p = p[0:l - 1]
y = int(x)
z = 10 ** (l - 1)
t = (y - z + 1) * l
tt = sum(p)
print(t + tt)


n = int(input())
p10 = 10
kd = 9
curkd = 1
ans = 0
while p10 <= n:
	ans += curkd * kd
	p10 *= 10
	kd *= 10
	curkd += 1
ans += (n + 1 - p10 // 10) * curkd
print(ans)


e = int(input())
i = 0
val = 1
res = 0
while i <= 9 and e >= val:
	res += e - val + 1
	val *= 10
	i += 1
print(res)


n = int(input())
fator = 1
cont = 0
while n >= 10 ** fator:
	fator += 1
for i in range(fator - 1):
	cont += 9 * 10 ** i * (i + 1)
cont += (n + 1 - 10 ** (fator - 1)) * fator
print(cont)


import bisect
b = []
a = []
b.append(0)
for i in range(1, 15):
	b.append(9 * i * 10 ** (i - 1))
a.append(b[0])
for i in range(1, 15):
	a.append(a[i - 1] + b[i])
n = int(input())
digits = 0
copy = n
while copy > 0:
	copy //= 10
	digits += 1
till = digits - 1
chars = 0
chars += a[till]
left = (n - 10 ** till + 1) * digits
chars += left
print(chars)


n = input()
s = len(n)
if int(n) <= 9:
	print(n)
else:
	b = 0
	for i in range(s - 1):
		t = []
		t.append(9)
		u = [0] * i
		t = t + u
		listToStr = ''.join(map(str, t))
		t = int(listToStr)
		a = t * (i + 1)
		b = a + b
	p1 = []
	p1.append(1)
	p2 = [0] * (s - 1)
	p1 = p1 + p2
	listToStr1 = ''.join(map(str, p1))
	p1 = int(listToStr1)
	p = int(n) + 1 - p1
	q = p * s
	r = b + q
	print(r)


m = int(input())
l = len(str(m))
s = 0
s += (m - 10 ** (l - 1) + 1) * l
for i in range(l - 1, 0, -1):
	s += 9 * 10 ** (i - 1) * i
print(s)


n = int(input())
length = len(str(n))
d = {}
total_sum = 0
for i in range(length):
	d[i + 1] = 9 * 10 ** i * (i + 1)
for j in range(length - 1):
	total_sum += d[j + 1]
total_sum += (n - 10 ** (length - 1) + 1) * length
print(total_sum)


n = input()
k = len(n)
t = 0
for i in range(1, k):
	t += int('9' + '0' * (i - 1)) * i
if k > 1:
	v = int(n) - int((k - 1) * '9')
else:
	v = int(n)
print(t + v * k)


n = int(input())
count = 0
for i in range(10)[::-1]:
	num = 10 ** i - 1
	count += (i + 1) * max(0, n - num)
	n = num if n - num > 0 else n
print(count)


n = int(input())
if n < 10:
	print(n)
if n >= 10 and n < 100:
	print(9 + (n - 9) * 2)
if n >= 100 and n < 1000:
	print(189 + (n - 99) * 3)
if n >= 1000 and n < 10000:
	print(2889 + (n - 999) * 4)
if n >= 10000 and n < 100000:
	print(38889 + (n - 9999) * 5)
if n >= 100000 and n < 1000000:
	print(488889 + (n - 99999) * 6)
if n >= 1000000 and n < 10000000:
	print(5888889 + (n - 999999) * 7)
if n >= 10000000 and n < 100000000:
	print(68888889 + (n - 9999999) * 8)
if n >= 100000000 and n < 1000000000:
	print(788888889 + (n - 99999999) * 9)
if n == 1000000000:
	print(8888888899)


import math
potencias = [0, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000]
pot_alg = [0, 11, 192, 2893, 38894, 488895, 5888896, 68888897, 788888898, 8888888899]
n = int(input())
m = int(math.log10(n))
x = pot_alg[m] + (n - potencias[m]) * (m + 1)
print(x)


N = int(input())
if N < 10:
	print(N)
	exit()
ans = 0
while True:
	rad = 10 ** (len(str(N)) - 1)
	ans += (N - rad + 1) * len(str(N))
	N = rad - 1
	if N == 0:
		print(ans)
		exit()


n = int(input())
print(len(str(n)) * (n + 1) - int('1' * len(str(n))))


n = int(input())
t = 0
k = [[1, 9], [10, 99], [100, 999], [1000, 9999], [10000, 99999], [100000, 999999], [1000000, 9999999], [10000000, 99999999], [100000000, 999999999], [1000000000, 9999999999], [10000000000, 99999999999], [100000000000, 999999999999]]
(nn, i) = (n, 0)
while True:
	if n >= k[i][0]:
		if n >= k[i][1]:
			t += (k[i][1] - k[i][0] + 1) * (i + 1)
		else:
			t += (n - k[i][0] + 1) * (i + 1)
		i += 1
	else:
		break
print(t)


def solve():
	s = input()
	n = int(s)
	if n < 10:
		print(n)
		return
	num_digits = len(s)
	sum = 0
	power10 = 1
	num = 1
	for i in range(1, num_digits):
		sum += num * power10
		power10 *= 10
		num += 1
	sum = sum * 9
	lower9_str = '9' * (num_digits - 1)
	lower9 = int(lower9_str)
	num_of_other_numbers = n - lower9
	num_of_other_digits = num_of_other_numbers * num_digits
	sum = sum + num_of_other_digits
	print(sum)
solve()


num_books = input()
size = len(num_books)
(first_num, second_num) = (9, 0)
for i in range(1, size):
	second_num = second_num + first_num * i
	first_num = first_num * 10
print(second_num + (int(num_books) - 10 ** (size - 1) + 1) * size)


n = int(input())
cont = 0
while True:
	if n < 10:
		cont += n
		break
	else:
		L = len(str(n))
		s = int(str(n)[1:])
		cont += (s + 1) * L
		n = n - s - 1
print(cont)


import math
j = 0
inp = int(input())
u = int(math.log10(inp)) + 1
res = 0
for i in range(u - 1):
	res += 10 ** i * 9 * (i + 1)
	j = i + 1
r = inp - 10 ** j
q = (r + 1) * (j + 1)
print(q + res)


(n, r, s, x) = (int(input()), 1, 0, 1)
while x <= n // 10:
	x *= 10
	s += 9 * r * x // 10
	r += 1
x = n - x + 1
s += r * x
print(s)


def solve(n):
	if n < 10:
		return n
	st = []
	while n != 0:
		st.append(n % 10)
		n = n // 10
	st.append(st.pop() - 1)
	(x, l) = (0, 1)
	for ii in st:
		x += ii * l
		l = l * 10
	ans = len(st) * (x + 1)
	for i in range(1, 10):
		dp[0].append(1)
	for i in range(1, 10):
		dp.append([])
		for j in range(10):
			dp[i].append(sum(dp[i - 1]))
	for i in range(1, len(st)):
		ans += i * sum(dp[i - 1])
	return ans
dp = [[0]]
n = int(input())
print(solve(n))


n = int(input())
k = len(str(n))
h = 9
c = 0
for i in range(1, k):
	c += h * i
	h = h * 10
if k == 1:
	print(n)
else:
	c += k * (n - int((k - 1) * '9'))
	print(c)


n = int(input())
sum = 0
m = n
k = 0
while m >= 10:
	m = m / 10
	k = k + 1
for i in range(k):
	sum = sum + pow(10, i) * (i + 1)
l = n - pow(10, k)
sum = sum * 9
sum = sum + (l + 1) * (k + 1)
print(sum)


pages = int(input())
digits = 0
count = 1
numDigi = 9
while pages > 0:
	if pages >= numDigi:
		digits += count * numDigi
		count += 1
		pages -= numDigi
		numDigi *= 10
	else:
		digits += count * pages
		pages = 0
print(digits)


a = [9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000, 9000000000, 90000000000]
n = input()
i = 0
j = 1
s = 0
if len(n) > 1:
	while j <= len(n) - 1:
		s = s + a[i] * j
		j = j + 1
		i = i + 1
	l = ['9' for i in range(len(n) - 1)]
	y = ''.join(l)
	y = int(y)
	q = (int(n) - int(y)) * j
	print(q + s)
else:
	print(n)


n = int(input())
ns = str(n)
l = len(ns)
list1 = [9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000]
list2 = [9, 99, 999, 9999, 99999, 999999, 9999999, 99999999]
ans = 0
if n == 1000000000:
	for i in range(len(list1)):
		ans += list1[i] * (i + 1)
	ans += 10
	print(ans)
elif l == 1:
	print(n)
else:
	for i in range(l - 1):
		ans += list1[i] * (i + 1)
	ans += (n - list2[l - 2]) * l
	print(ans)


n = int(input())
List = [0, 9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000, 9000000000]
i = 1
count = 0
while n > List[i]:
	count += List[i] * i
	n -= List[i]
	i += 1
count += n * i
print(count)


import itertools as ittls
from collections import Counter
import string

def sqr(x):
	return x * x

def inputarray(func=int):
	return map(func, input().split())
N = int(input())
(k, s) = (1, 0)
while k <= N:
	s = s + N - k + 1
	k = 10 * k
print(s)


n = int(input())
L = len(str(n))
c = 9
ans = 0
i = 1
while i < L:
	ans += c * i
	c *= 10
	i += 1
k = c // 9 - 1
ans += (n - k) * L
print(ans)


n = input()
l = len(n)
intN = int(n)
total = 0
for i in range(l, 0, -1):
	badDibo = intN - (pow(10, i - 1) - 1)
	total += badDibo * i
	intN = intN - badDibo
print(total)


__author__ = 'Andrey'

def integer(s):
	if s:
		return int(s)
	else:
		return 0

def solve(n):
	str_n = str(n)
	l_n = len(str_n)
	s = 0
	for i in range(1, l_n):
		s += (10 ** i - 10 ** (i - 1)) * i
	s += (n - 10 ** (l_n - 1) + 1) * l_n
	return s
n = int(input())
print(solve(n))


n = input()
b = int(n)
print(len(n) * (b + 1) - int('1' * len(n)))


n_books = int(input())
x = 0
length = 1
while n_books > 10 ** length - 1:
	x += (10 ** length - 10 ** (length - 1)) * length
	length += 1
x += (n_books - 10 ** (length - 1) + 1) * length
print(x)


n = int(input())
if n <= 9:
	print(n)
	quit()
length = len(str(n))
num = 9
ans = 0
while len(str(num)) < length:
	ans += num * len(str(num))
	num = int(str(num) + '0')
ans += (n - int(''.join(['9'] * (len(str(num)) - 1)))) * len(str(num))
print(ans)


(n, r, b) = (int(input()), 0, 0)
while n >= 10 ** b:
	r += (b + 1) * (min(n, 10 ** (b + 1) - 1) - 10 ** b + 1)
	b += 1
print(r)


import math
c = str(input())
length = len(c)
sum = 0
k = int(c) - 10 ** (length - 1) + 1
sum += k * length
temp = int(c) - k
for i in range(length - 1):
	sum += temp % 10 * 10 ** i * (i + 1)
	temp = math.floor(temp / 10)
print(sum)


n = int(input())
len_n = len(str(n))
q = len_n * n
i = 1
ns = 9
while i < len_n:
	q -= ns * (len_n - i)
	i += 1
	ns *= 10
print(q)


n = int(input())
sum1 = 0
weishu = len(str(n))
num1 = 1
if weishu > 1:
	while num1 < weishu:
		sum1 += num1 * (9 * 10 ** (num1 - 1))
		num1 += 1
	number = n - 10 ** (weishu - 1) + 1
	sum1 += weishu * number
else:
	sum1 = n
print(sum1)


__author__ = 'Rakshak.R.Hegde'
n = int(input())
total = min(9, n)
t = 1
for i in range(2, 11):
	t *= 10
	if n >= t:
		total += min(t * 9, n - (t - 1)) * i
print(total)


n = input()
res = 0
k = 1
max = int('1' + '0' * (len(n) - 1))
for count in range(1, len(n)):
	res += count * k * 9
	k *= 10
res += (int(n) - max + 1) * len(n)
print(res)


s = input()
c = 0
n = len(s)
for i in range(1, n):
	c += int('9' + '0' * (i - 1)) * i
c += (int(s) - 10 ** (n - 1) + 1) * n
print(c)


n = int(input())
if n < 10:
	print(n)
else:
	i = 0
	s = 0
	t = 2
	ii = 0
	while t != 0:
		i += 1
		t = n // 10 ** i
	ii = i - 1
	p = 1
	for p in range(1, i):
		s += 9 * p * 10 ** (p - 1)
	s += (n + 1 - 10 ** ii) * i
	print(s)


n = int(input())
c = len(str(n))
ans = 0
foo = [1, 11, 192, 2893, 38894, 488895, 5888896, 68888897, 788888898, 8888888899]
if c > 1:
	ans += foo[c - 1]
	ans += (n - 10 ** (c - 1)) * c
else:
	ans = n
print(ans)


n = int(input())
ans = 0
num = 9
for i in range(10):
	if n > num:
		n -= num
		ans += num * (i + 1)
		num *= 10
	else:
		ans += n * (i + 1)
		break
print(ans)


n = int(input())
print(sum((i * max(0, min(10 ** i, n + 1) - 10 ** (i - 1)) for i in range(1, 11))))


num = int(input())
n = len(str(num))
lim = [0, 0, 9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999, 9999999999]
acum = 0
while num > 0:
	dif = num - lim[n]
	acum += dif * n
	num = lim[n]
	n -= 1
print(acum)


n = input()
x = len(n)
print(int(n) * x + x - int('1' * x))


n = input()
x = 0
for i in range(1, len(n)):
	x = x + (10 ** i - 10 ** (i - 1)) * i
r = x + (int(n) - 10 ** (len(n) - 1) + 1) * len(n)
print(r)


def f(n):
	if n < 10:
		return n
	k = 10 ** (len(str(n)) - 1)
	return len(str(n)) * (n % k + 1) + f(n - n % k - 1)
n = int(input())
print(f(n))


n = int(input())
if n < 10:
	print(n)
else:
	digits = len(str(n))
	base = 0
	for i in range(1, digits):
		base += i * 9 * 10 ** (i - 1)
	print(digits * (n - int('9' * (digits - 1))) + base)


n = input()
l = len(n) - 1
s = 0
for i in range(l, -1, -1):
	s = s + 10 ** i
print((int(n) + 1) * int(len(n)) - s)


n = int(input())
r = 0
for i in range(1, len(str(n)) + 1):
	if n >= 10 ** i:
		r += (10 ** i - 1 - (10 ** (i - 1) - 1)) * i
	else:
		r += (n - (10 ** (i - 1) - 1)) * i
print(r)


n = int(input())
y = len(str(n))
z = 0
if y == 1:
	print(n)
elif y > 1:
	for i in range(1, y):
		z = z + (n - (10 ** i - 1))
	print(z + n)


t = int(input())
sum = 0
i = 9
while t > 0:
	sum += t
	t -= i
	i *= 10
print(sum)


n = int(input())
res = min(9, n)
for i in range(1, 10):
	res += max(min(9 * 10 ** i, n - 10 ** i + 1), 0) * (i + 1)
print(res)


n = int(input())
k = len(str(n)) - 1
l = (n - 10 ** k + 1) * (k + 1)
while k > 0:
	k -= 1
	l += 10 ** k * 9 * (k + 1)
print(l)


n = int(input())
t = n
s = n
k = 0
p = 10
while n >= p:
	s += n - (p - 1)
	p *= 10
print(s)


def countDigits(n):
	ans = 0
	while n > 0:
		ans += 1
		n //= 10
	return ans
books = int(input().strip())
d = countDigits(books)
if d == 1:
	ans = books
else:
	aux = [0] * d
	aux[1] = 9
	for i in range(2, d):
		aux[i] = aux[i - 1] * 10 + 9
	ans = 0
	for i in range(d):
		ans += (aux[i] - aux[i - 1]) * i
	ans += (books - aux[d - 1]) * d
print(ans)


a = int(input())
saida = 0
while a > 0:
	tam = len(str(a))
	if tam > 1:
		cont = '9' * (tam - 1)
		saida += (a - int(cont)) * tam
	else:
		saida += a
		break
	a -= a - int(cont)
print(saida)


n = int(input())
temp = [9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999, 1000000000]
temp2 = [9, 189, 2889, 38889, 488889, 5888889, 68888889, 788888889, 8888888889, 8888888899]
i = 0
while n > temp[i]:
	i += 1
print(temp2[i] + (n - temp[i]) * (i + 1))


def find_numbers_count(number, rank):
	res = number * rank
	it = rank
	while it != 1:
		it -= 1
		res = res - (pow(10, it) - 1)
	return res
number = input()
rank = len(number)
print(find_numbers_count(int(number), rank))


n = input()
num = int(n)
if num <= 9:
	print(num)
elif 9 < num <= 99:
	d = num - 9
	d *= 2
	print(9 + d)
elif 99 < num <= 999:
	d = num - 99
	d *= 3
	print(9 + 90 * 2 + d)
elif 999 < num <= 9999:
	d = num - 999
	d *= 4
	print(9 + 90 * 2 + 900 * 3 + d)
elif 9999 < num <= 99999:
	d = num - 9999
	d *= 5
	print(9 + 90 * 2 + 900 * 3 + 9000 * 4 + d)
elif 99999 < num <= 999999:
	d = num - 99999
	d *= 6
	print(9 + 90 * 2 + 900 * 3 + 9000 * 4 + 90000 * 5 + d)
elif 999999 < num <= 9999999:
	d = num - 999999
	d *= 7
	print(9 + 90 * 2 + 900 * 3 + 9000 * 4 + 90000 * 5 + 900000 * 6 + d)
elif 9999999 < num <= 99999999:
	d = num - 9999999
	d *= 8
	print(9 + 90 * 2 + 900 * 3 + 9000 * 4 + 90000 * 5 + 900000 * 6 + 9000000 * 7 + d)
elif 99999999 < num <= 999999999:
	d = num - 99999999
	d *= 9
	print(9 + 90 * 2 + 900 * 3 + 9000 * 4 + 90000 * 5 + 900000 * 6 + 9000000 * 7 + 90000000 * 8 + d)
else:
	d = num - 999999999
	d *= 10
	print(9 + 90 * 2 + 900 * 3 + 9000 * 4 + 90000 * 5 + 900000 * 6 + 9000000 * 7 + 90000000 * 8 + 900000000 * 9 + d)


n = int(input())
pre = []
arr = []
index = []
y = 0
for i in range(12):
	x = 9 * pow(10, i)
	y = y + x
	pre.append(y)
for i in range(12):
	x = 9 * pow(10, i) * (i + 1)
	arr.append(x)
for i in range(12):
	index.append(i + 1)
dup = n
dig = 0
while dup > 0:
	rem = dup % 10
	dig = dig + 1
	dup = dup // 10
if dig == 1:
	fin = n
	print(fin)
else:
	fin = n - pre[dig - 2]
	f = fin * dig
	for i in range(0, dig - 1):
		f = f + arr[i]
	print(f)


book = input().strip('\n')
books = int(book)
x = '1'
for i in range(0, len(book) - 1):
	x = x + '0'
y = 0
if int(books) < 10:
	y = books
else:
	y = 9 + len(book) * (books - int(x) + 1)
	for i in range(1, len(x) - 1):
		y = y + (len(book) - i) * (int(x[:-i]) * 9)
print(y)


a = int(input())
print(sum((a - 10 ** i + 1 for i in range(len(str(a))))))


import math
from collections import defaultdict

class Logger:
	muted = False

	@staticmethod
	def log(*msg: str) -> None:
		if not Logger.muted:
			print('[', *msg, ']')

	def mute() -> None:
		Logger.muted = True

	def unmute() -> None:
		Logger.muted = False

def solve(n: int):
	if n < 10:
		print(n)
		return
	exponent = 2
	base = 10 ** exponent
	answer = 9
	while n > base:
		answer += (base - base // 10) * exponent
		exponent += 1
		base *= 10
	answer += (n - base // 10 + 1) * exponent
	if n == base:
		answer += 1
	print(answer)

def main():
	n = int(input())
	solve(n)
main()


n = input()
total = 0
length = len(n)
a = '0'
for i in range(1, length):
	total += 9 * 10 ** (i - 1) * i
for i in range(length - 1):
	a = a + '9'
b = int(n) - int(a)
total += b * length
print(int(total))


mod = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
n = ii()
d = len(str(n))
nd = d * (n + 1) - int('1' * d)
print(nd)


a = int(input())
p = 0
for i in range(len(str(a))):
	p = p + i * (9 * 10 ** (i - 1))
q = a - 10 ** (len(str(a)) - 1)
q += 1
p += len(str(a)) * q
print(int(p))


def countDigit(n):
	count = 0
	while n != 0:
		n //= 10
		count += 1
	return count
n = int(input())
d = countDigit(n)
s = 0
for i in range(1, d):
	s = s + 9 * (i * pow(10, i - 1))
sum = s + d * (n - pow(10, d - 1) + 1)
print(sum)


n = int(input())
ans = 0
for i in range(len(str(n))):
	ans += n - 10 ** i + 1
print(ans)


import math
n = int(input())
answer = 0
i = 0
while math.pow(10, i) <= n:
	answer = answer + n + 1 - int(math.pow(10, i))
	i = i + 1
print(answer)


n = input()
if len(n) == 1:
	print(n)
else:
	sum = 0
	for i in range(len(n) - 1):
		s = '9' + '0' * i
		temp = int(s)
		sum = sum + temp * (i + 1)
	s2 = '1' + '0' * (len(n) - 1)
	temp2 = int(s2)
	res = int(n) - temp2 + 1
	sum = sum + res * len(n)
	print(sum)


n = input()
s = 0
if int(n) >= 10:
	x = len(n) + len(n) * (int(n) - pow(10, len(n) - 1))
	for i in range(len(n) - 1, 1, -1):
		s += i * (pow(10, i) - pow(10, i - 1))
	print(s + 9 + x)
else:
	print(n)


import math
N = int(input())
i = 1
ans = 0
while i <= N:
	if i * 10 <= N:
		ans += (math.floor(math.log10(i)) + 1) * (i * 10 - i)
		i *= 10
	else:
		ans += (math.floor(math.log10(i)) + 1) * (N - i + 1)
		i = N + 1
print(ans)


n = int(input())
digits_number = 0
power_10 = 1
while power_10 <= n:
	digits_number += n - (power_10 - 1)
	power_10 *= 10
print(digits_number)


a = int(input())
ans = 0
for l in range(1, 11):
	if l == len(str(a)):
		ans += (a - 10 ** (l - 1) + 1) * l
	elif l < len(str(a)):
		ans += 9 * 10 ** (l - 1) * l
	else:
		break
print(ans)


n = int(input())
m = n
i = 0
cnt = 0
while m // 10:
	cnt += 9 * 10 ** i * (i + 1)
	i += 1
	m //= 10
cnt += (n - 10 ** i + 1) * (i + 1)
print(cnt)


n = int(input())
x = len(str(n))
sum = 0
sum += x * (n - 10 ** (x - 1) + 1)
x -= 1
while x > 0:
	sum += x * 9 * 10 ** (x - 1)
	x -= 1
print(sum)


import math
n = input()
a = []
for i in range(0, 10):
	k = 9 * math.pow(10, i) * (i + 1)
	a.append(int(k))
print(sum(a[:len(n) - 1]) + int((int(n) - math.pow(10, len(n) - 1) + 1) * len(n)))


n = input()
if len(n) == 1:
	print(n)
else:
	pw = 1
	res = 0
	for i in range(0, len(n) - 1):
		res += (pow(10, i + 1) - pow(10, i)) * (i + 1)
	res += (int(n) - pow(10, len(n) - 1)) * len(n)
	print(res + len(n))


n = int(input())
if n < 10:
	print(n)
else:
	digits = 0
	temp = n
	while temp != 0:
		temp //= 10
		digits += 1
	res = 9
	for i in range(1, digits - 1):
		t = int('9' * (i + 1))
		res += (t - int('9' * i)) * (i + 1)
	res += (n - int('1' + '0' * (digits - 1)) + 1) * digits
	print(res)


n = input()
a = list()
numbers = [9, 189, 2889, 38889, 488889, 5888889, 68888889, 788888889, 8888888889]
if len(n) > 1:
	for i in range(len(n) - 1):
		a.append('9')
	a = int(''.join(a))
	cnt = len(n) * (int(n) - a)
	cnt = cnt + numbers[len(n) - 2]
else:
	cnt = n
print(cnt)


n = int(input())
a = [0, 9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999, 9999999999]
x = 1
ans = 0
for i in range(1, 11):
	if n >= a[i]:
		ans += (a[i] - a[i - 1]) * x
	else:
		ans += (n - a[i - 1]) * x
		break
	x += 1
print(ans)


def ii():
	return int(input())

def ss():
	return [x for x in input()]

def si():
	return [int(x) for x in input().split()]

def mi():
	return map(int, input().split())
a = ii()
s = 0
nums = 0
for i in range(1, 100):
	if a >= 10 ** i:
		nums += 10 ** (i - 1) * 9 * i
	else:
		break
nums += (a - (10 ** (i - 1) - 1)) * i
print(nums)


n = int(input())
res = 0
for p in range(1, 12):
	pot = 10 ** p
	prev = 10 ** (p - 1)
	if n < pot:
		res += p * (n - prev + 1)
		break
	else:
		res += p * (pot - prev)
print(res)


n = input()
x = len(n)
ans = 0
k = 9
for i in range(1, x):
	ans += k * i
	k *= 10
ans += (int(n) - 10 ** (x - 1) + 1) * x
print(ans)


n = int(input())

def countd(n):
	d = 0
	while n >= 10 ** d:
		d += 1
	count = 0
	while d > 0:
		tens = 10 ** (d - 1)
		count += (n - tens + 1) * d
		n = tens - 1
		d -= 1
	return count
print(countd(n))


n = int(input())
z = 10
r = 1
p = 1
k = 0
while n > z:
	k = k + (z - r) * p
	r = r * 10
	z = z * 10
	p = p + 1
if n // z == 1:
	print(k + (n - r) * p + p + 1)
else:
	print(k + (n - r + 1) * p)


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')
MOD = 1000000007

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactors(n):
	factors = []
	i = 2
	while i ** 2 <= n:
		while n % i == 0:
			factors.append(i)
			n //= i
		i += 1
	if n > 1:
		factors.append(n)
	return factors

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def main():
	n = int(input())
	ten = int('1' + '0' * len(str(n)))
	l = len(str(n))
	ans = 0
	while n:
		ten //= 10
		ans += (n - ten + 1) * l
		l -= 1
		n = ten - 1
	print(ans)
t = 1
for _ in range(t):
	main()


numero = input()
aux = list(numero)
tamanho = len(aux)
numero = int(numero)
soma = 0
fator = 9
acc = 0
mult = 0
for i in range(1, tamanho, 1):
	mult = i
	acc += fator * pow(10, i - 1)
	soma += fator * pow(10, i - 1) * mult
resto = numero - acc
soma += resto * (mult + 1)
print(soma)


n = int(input())
if n <= 9:
	print(n)
else:
	R = len(str(n)) - 1
	ans = 0
	V = 0
	while R != 0:
		A = R * 9
		B = 10 ** (R - 1)
		ans += A * B
		if V == 0:
			V = 1
			N = B * 10
			J = n - N + 1
			ans += J * len(str(n))
		R -= 1
	print(ans)


(n, a, c, i) = (int(input()), 0, 9, 1)
while n - c >= 0:
	n -= c
	a += c * i
	c *= 10
	i += 1
print(a + n * i)


n = int(input())
l = len(str(n))
ro = int(((9 * l - 10) * 10 ** (l - 1) + 1) / 9)
if l != 1:
	yo = n - int('9' * (l - 1))
else:
	yo = n
yoyo = yo * l
ans = ro + yoyo
print(ans)


n = input()
z = len(n) - 1
n = int(n)
x = 1
ans = 0
while n > 9:
	q = int('9' * z)
	k = (n - q) * (z + 1)
	ans += k
	n = q
	z -= 1
ans += n
print(ans)


n = input()
res = 0
for i in range(1, len(n)):
	res += 9 * i * 10 ** (i - 1)
res += (int(n) - 10 ** (len(n) - 1) + 1) * len(n)
print(res)


totallis = [9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000, 9000000000, 90000000000, 900000000000, 9000000000000, 90000000000000]
inp = input()
ghat = len(inp)
intinp = int(inp)
digits = 0
if ghat > 1:
	for i in range(ghat - 1):
		digits += totallis[i] * (i + 1)
	rest = intinp - 10 ** (i + 1) + 1
	digits += rest * (i + 2)
else:
	digits = intinp
print(digits)


n = int(input())
sk = 0
k = 1
x = 9
while n > 0:
	if n >= x:
		sk += x * k
		n -= x
		x *= 10
		k += 1
	else:
		sk += n * k
		n = 0
print(sk)


n = input()
c = 0
l = len(n) - 1
if len(n) >= 2:
	for i in range(len(n) - 1):
		c += int('9' + '0' * i) * (i + 1)
	c += 1
	k = (int(n[0] + '0' * l) - int('1' + '0' * l)) * (l + 1) + int(n[1:]) * (l + 1) + l
	print(c + k)
else:
	print(n)


n = int(input())
c = 0
t = 9
i = 0
p = 9
l = 0
while True:
	i += 1
	c = c + t
	l = l + t * i
	if c + t * (i + 1) >= n:
		break
	t = t * 10
	p += t
i = len(str(n))
print(l + (n - p) * i)


import math
n = eval(input())
nn = n
cnt = 0
while nn != 0:
	cnt += 1
	nn //= 10
now = 9
pre = 0
ans = 0
for i in range(1, cnt):
	ans += i * (now - pre)
	pre = pre * 10 + 9
	now = now * 10 + 9
re = n - pre
ans += re * cnt
print(ans)


n = int(input())
s = []
while n:
	if n <= 9:
		s.append(n * 1)
		break
	l = len(str(n))
	t = int('1' + '0' * (l - 1)) - 1
	s.append((n - t) * l)
	n = t
print(sum(s))


from math import *
n = int(input())
r = 0
i = 0
l = 10
while l <= n:
	r += (i + 1) * (l - l // 10)
	i += 1
	l *= 10
if l == n:
	print(r + i + 1)
else:
	print(r + (i + 1) * (n - l // 10 + 1))


n = int(input())
numbers = 0
add = 9
mult = 1
mult2 = 1
while n >= mult2 * 10:
	numbers += 9 * mult * mult2
	mult += 1
	mult2 *= 10
numbers += (n - mult2 + 1) * mult
print(numbers)


import math
n = int(input())
digits = 0
a = int(math.log10(n)) + 1
for x in range(1, a):
	digits += 10 ** (x - 1) * 9 * x
digits += (n - 10 ** (a - 1) + 1) * a
print(digits)


def f(x):
	t = 0
	while x:
		t += 1
		x //= 10
	return t
n = int(input())
k = f(n)
digit = 0
for i in range(k - 1):
	digit += 9 * 10 ** i * (i + 1)
digit += (n - 10 ** (k - 1) + 1) * k
print(digit)


n = int(input())
a = 0
p = n
for i in range(1, 10):
	p = p / 10
	if p >= 1:
		a = a + 1
	else:
		break
n = n - 10 ** a + 1
Sum = n * (a + 1)
while a > 0:
	Sum = Sum + 9 * 10 ** (a - 1) * a
	a = a - 1
print(Sum)


s = []
for i in range(10):
	s.append((i + 1) * (10 ** (i + 1) - 10 ** i))
n = int(input())
ind = 0
for i in range(len(s)):
	if 10 ** (i + 1) > n:
		ind = i
		break
if ind == 0:
	print(n)
else:
	n -= 10 ** ind
	print(sum(s[:ind]) + (ind + 1) * (n + 1))


import sys
inf = float('inf')
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
(mod, MOD) = (1000000007, 998244353)
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
n = int(input())
myArr = [9 * i * 10 ** (i - 1) for i in range(1, 10)]
if n <= 9:
	print(n)
else:
	z = n - int((len(str(n)) - 1) * '9')
	count = z * len(str(n))
	for i in range(len(str(n)) - 1):
		count += myArr[i]
	print(count)


n = input()
c = len(n)
print(int(n) * c + c - int('1' * c))


n = int(input())
m = 9
k = 0
i = 1
while n > m:
	n -= m
	k += m * i
	m *= 10
	i += 1
k += i * n
print(k)


import sys
import math
import bisect

def solve(n):
	ans = 0
	for i in range(10):
		low = 10 ** i
		if n >= low:
			val = n - low + 1
		else:
			val = 0
		ans += val
	return ans

def main():
	n = int(input())
	ans = solve(n)
	print(ans)
main()


n = int(input())
now = 1
ans = 0
while n > 0:
	ans += n
	n -= now * 9
	now *= 10
print(ans)


n = input()
m = len(str(n))
n = int(n)
total = (n - 10 ** (m - 1) + 1) * m
for i in range(m - 1):
	total = total + (10 ** (i + 1) - 10 ** i) * (i + 1)
print(total)


n = input()
l = len(n)
sum1 = 0
for i in range(1, l):
	sum1 += i * 9 * 10 ** (i - 1)
p = (int(n) - 10 ** (l - 1) + 1) * l
print(sum1 + p)


num_books = int(input())
n = 1
sum_digits = 0
num_valid_numbers = 9
while True:
	if num_books > num_valid_numbers:
		sum_digits += num_valid_numbers * n
		num_books -= num_valid_numbers
		num_valid_numbers *= 10
		n += 1
	else:
		sum_digits += num_books * n
		break
print(sum_digits)


a = int(input())
p = 0
for j in range(len(str(a)), 1, -1):
	if j == len(str(a)):
		p += (a - int((j - 1) * '9')) * j
	else:
		p += (int('9' * j) - int('9' * (j - 1))) * j
if a > 9:
	print(p + 9)
else:
	print(a)


import os
import sys
from math import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return map(int, input().split())

def array():
	return [int(i) for i in input().split()]
n = int(input())
i = 0
while 10 ** i <= n:
	i += 1
if i == 1:
	print(n)
	exit()
last = 0
ans = 0
for j in range(1, i):
	last = 0.9 * 10 ** j * j
	ans += last
ans += (n - 10 ** (i - 1) + 1) * i
print(int(ans))


n = int(input())
rez = 0
for l in range(1, 11):
	if l == len(str(n)):
		rez = rez + (n - 10 ** (l - 1) + 1) * l
	elif l < len(str(n)):
		rez = rez + 9 * 10 ** (l - 1) * l
	else:
		break
print(rez)


n = input()
l = len(n)
n = int(n)
d = 0
for i in range(1, l):
	d = d + 9 * 10 ** (i - 1) * i
d = d + (n + 1 - 10 ** (l - 1)) * l
print(d)


n = int(input())
temp = 0
l = len(str(n))
arr = [0] * 10
for i in range(1, 10):
	temp += i * (9 * 10 ** (i - 1))
	arr[i] = temp
print(arr[l - 1] + l * (n + 1 - 10 ** (l - 1)))


from sys import stdin, stdout
import math
n = int(stdin.readline())
i = 0
j = 1
ans = 0
final = 9 * pow(10, i)
if n <= 9:
	ans = n
else:
	while n > final:
		n = n - final
		ans += final * j
		j += 1
		i += 1
		final = 9 * pow(10, i)
	ans += n * j
stdout.write(str(ans) + '\n')


q = '9' * 10
w = int(input())
y = w
r = 0
t = 0
while y // 10:
	t += 1
	y = y // 10
for i in range(t):
	r += (i + 1) * int('9' + '0' * i)
r += (t + 1) * (w - int('0' + '9' * t))
print(r)


n = int(input())
l = len(f'{n}')
ans = l * (n + 1) - int(l * '1')
print(ans)


n = int(input())
p = n
i = 1
l = 1
sd = 0
s = 0
j = 1
while n > 9:
	n = int(n / 10)
	i *= 10
	l += 1
if p > 9:
	while i != 1:
		s = p - i
		if j == 1:
			s = s + 1
		sd += s * l
		p = i
		i = i / 10
		l -= 1
		j += 1
	p = 9
print(int(p + sd))


n = int(input())
st10 = 1
kol = 1
while st10 * 10 <= n:
	st10 *= 10
	kol += 1
s = 0
while n > 9:
	s += (n - st10 + 1) * kol
	kol -= 1
	n = st10 - 1
	st10 //= 10
print(s + n)


n = int(input())
ans = 0
x = n
digit = 0
while x != 0:
	digit += 1
	x //= 10
if digit == 1:
	ans = n
else:
	sumx = 0
	for i in range(1, digit):
		ans += 9 * (10 ** (i - 1) * i)
		sumx += 9 * 10 ** (i - 1)
	ans += (n - sumx) * digit
print(ans)


a = list(input())
k = len(a)
t = pow(10, k - 1)
total = (int(''.join(a[:k])) - t + 1) * k
i = k - 2
while i >= 0:
	t = pow(10, i + 1) - 1
	b = pow(10, i)
	total = total + (t - b + 1) * (i + 1)
	i = i - 1
print(total)


n = int(input())
answer = 0
for i in range(1, 11):
	if n >= 10 ** i:
		answer += i * 9 * 10 ** (i - 1)
	else:
		answer += i * (n - 10 ** (i - 1) + 1)
		break
print(answer)


n = int(input())
res = 0
for i in range(10):
	if n >= 10 ** i:
		if n > 10 ** (i + 1) - 1:
			res += 9 * 10 ** i * (i + 1)
		else:
			res += (n - 10 ** i + 1) * (i + 1)
			print(res)
			exit()


n = int(input())
res = 0
t = [0] * 10
r = [0] * 10
for i in range(1, 10):
	t[i] = t[i - 1] + 9 * 10 ** (i - 1)
	r[i] = r[i - 1] + 9 * 10 ** (i - 1) * i
l = [n > t[i] for i in range(10)]
for i in range(10):
	if not l[i]:
		res += r[i - 1] + (n - t[i - 1]) * i
		break
print(8888888899 if n == 1000000000 else res)


n = int(input())
c = 0
l = len(str(n))
if l == 1:
	print(n)
else:
	k = 1
	while k < l:
		c += (pow(10, k) - pow(10, k - 1)) * k
		k = k + 1
	c += (n - pow(10, l - 1) + 1) * l
	print(c)


n = int(input())
num_digits = 0
l = 1
pow10 = 10
while n >= pow10:
	num_digits += l * 9 * (pow10 // 10)
	pow10 *= 10
	l += 1
num_digits += l * (n - pow10 // 10 + 1)
print(str(num_digits))


n = int(input())
a = 1
c = 0
t = 1
while a * 10 <= n:
	c += t * (a * 9)
	t += 1
	a *= 10
c += (n - a + 1) * t
print(c)


n = int(input())
l = len(str(n))
count = 0
x = 1
y = 1
if l == 1:
	print(n)
else:
	for i in range(len(str(n)) - 1):
		count += 9 * x * y
		x *= 10
		y += 1
	print(count + l * (n - 10 ** (l - 1) + 1))


def no_of_digits(n):
	l = len(n)
	return int(n) * l + l - int('1' * l)
n = input()
print(no_of_digits(n))


n = int(input())
a = int()
k = int()
while n >= k:
	a += n - k
	k = k * 10 + 9
print(a)


c = input()
b = len(c)
sume = 0
a = 9
d = 1
while b > 1:
	sume += a * d
	a *= 10
	d += 1
	b -= 1
r = int(c)
if len(c) == 1:
	print(c)
else:
	a /= 10
	a = int(a)
	t = ''
	for i in range(len(str(a))):
		t += '9'
	t = int(t)
	r -= t
	sume += r * d
	sume = int(sume)
	print(sume)


s = input()
n = int(s)
r = 0
k = 10 ** 0
for i in range(len(s)):
	r += (10 ** i - k) * i
	k = 10 ** i
r += (n - (k - 1)) * (i + 1)
print(r)


x = int(input())
nine = 9
sum = 0
low = 0
for i in range(1, 10):
	if low * 10 + 9 < x:
		sum = sum + nine * i
	else:
		sum = sum + (x - low) * i
		break
	nine = nine * 10
	low = low * 10 + 9
if x == 1000000000:
	sum = sum + 10
print(sum)


import math

def proB(n):
	k = int(math.log10(n) + 1)
	bor = 10 ** (k - 1)
	ans = (n - bor + 1) * k
	k -= 1
	while k != 0:
		ans += (int('9' * k) - 10 ** (k - 1) + 1) * k
		k -= 1
	return ans
n = int(input())
print(proB(n))


a = input()
n = len(a)
b = [0, 9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000, 9000000000]
ans = 0
for i in range(1, n):
	ans += b[i] * i
ans += n * (int(a) - 10 ** (n - 1) + 1)
print(ans)


s = input()
n = int(s)
q = len(s)
k = 9
j = 1
s = 0
if n <= 9:
	print(n)
else:
	for i in range(1, q):
		s = s + k * j
		j = j + 1
		k = k * 10
	w = s + (n + 1 - 10 ** (q - 1)) * q
	print(w)


n = input()
l = len(n)
rez = int(n) * l + l - int('1' * l)
print(rez)


n = int(input())
ans = 0
x = n
digit = 0
u = str(n)
digit = len(u)
if digit == 1:
	ans = n
else:
	sumx = 0
	for i in range(1, digit):
		ans += 9 * (10 ** (i - 1) * i)
		sumx += 9 * 10 ** (i - 1)
	ans += (n - sumx) * digit
print(ans)


n = int(input())
(i, j) = (1, 0)
while n >= i:
	j += n - i + 1
	i *= 10
print(j)


def populate():
	lis = [0]
	for i in range(1, 10):
		lis.append(lis[-1] + i * (10 ** i - 10 ** (i - 1)))
	return lis
glob = populate()
n = input()
l = len(n)
print(glob[l - 1] + l * (1 + int(n) - 10 ** (l - 1)))


n = int(input())
digits = len(list(str(n)))
total = 0
for x in range(digits - 1):
	subtract = 10 ** x * 9
	total += subtract * (x + 1)
	n = n - subtract
total += n * digits
print(total)


n = int(input())
(m, digit) = (n, 0)
while m != 0:
	m //= 10
	digit += 1
sum_of_digits = 0
for i in range(digit - 1):
	sum_of_digits += (i + 1) * (9 * 10 ** i)
sum_of_digits += (n - 10 ** (digit - 1) + 1) * digit
print(sum_of_digits)


n = int(input())
if n < 10:
	X = n + 1 - 1
elif n < 100:
	X = 2 * (n + 1) - 11
elif n < 1000:
	X = 3 * (n + 1) - 111
elif n < 10000:
	X = 4 * (n + 1) - 1111
elif n < 100000:
	X = 5 * (n + 1) - 11111
elif n < 1000000:
	X = 6 * (n + 1) - 111111
elif n < 10000000:
	X = 7 * (n + 1) - 1111111
elif n < 100000000:
	X = 8 * (n + 1) - 11111111
elif n < 1000000000:
	X = 9 * (n + 1) - 111111111
else:
	X = 10 * (n + 1) - 1111111111
print(int(X))


n = int(input())
(t, l) = (9, 0)
r = 1
while True:
	if n <= t:
		l += r * n
		break
	else:
		l += t * r
		r = r + 1
		n = n - t
		t = t * 10
print(l)


n = int(input())
if n < 10:
	print(n)
elif n < 100:
	print(9 + (n - 9) * 2)
elif n < 1000:
	print(9 + (99 - 9) * 2 + (n - 99) * 3)
elif n < 10000:
	print(9 + (99 - 9) * 2 + (999 - 99) * 3 + (n - 999) * 4)
elif n < 100000:
	print(9 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (n - 9999) * 5)
elif n < 1000000:
	print(9 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5 + (n - 99999) * 6)
elif n < 10000000:
	print(9 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5 + (999999 - 99999) * 6 + (n - 999999) * 7)
elif n < 100000000:
	print(9 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5 + (999999 - 99999) * 6 + (9999999 - 999999) * 7 + (n - 9999999) * 8)
elif n < 1000000000:
	print(9 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5 + (999999 - 99999) * 6 + (9999999 - 999999) * 7 + (99999999 - 9999999) * 8 + (n - 99999999) * 9)
if n == 1000000000:
	print(9 + (99 - 9) * 2 + (999 - 99) * 3 + (9999 - 999) * 4 + (99999 - 9999) * 5 + (999999 - 99999) * 6 + (9999999 - 999999) * 7 + (99999999 - 9999999) * 8 + (999999999 - 99999999) * 9 + 10)


def f(a):
	k = 0
	s = len(str(a))
	for i in range(1, s):
		k += (int('9' * i) - int('1' + '0' * (i - 1)) + 1) * i
	k += (a - int('1' + '0' * (s - 1)) + 1) * s
	return k
a = int(input())
print(f(a))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	r = 0
	for i in range(100):
		t = 9 * 10 ** i
		if n <= t:
			r += (i + 1) * n
			break
		r += (i + 1) * t
		n -= t
	return r
print(main())


n = int(input())
i = 1
d = 0
while 1:
	if n // int(pow(10, i)) == 0:
		break
	i += 1
while i >= 1:
	d += (n - int(pow(10, i - 1)) + 1) * i
	n = int(pow(10, i - 1)) - 1
	i -= 1
print(d)


s = input()
l = len(list(s))
ans = 0
if int(s) < 100:
	if int(s) >= 10:
		ans = (int(s) - 9) * 2 + 9
	else:
		ans = int(s)
else:
	s2 = '1' + '0' * (l - 1)
	ans = (int(s) - int(s2) + 1) * l
	c = str(int(s2) - int('1' + '0' * (l - 2)))
	i = l - 1
	while len(c) >= 1:
		ans += int(c) * len(c)
		i = i - 1
		c = c[0:i]
print(ans)


n = int(input())
ans = 0
if n < 10:
	print(n)
else:
	i = 1
	ans = 0
	while i <= n:
		ans += n - i + 1
		i *= 10
	print(ans)


a = input()
summ = 0
lena = len(a)
for i in range(1, lena):
	summ += 10 ** (i - 1) * 9 * i
summ += lena * (int(a) - 10 ** (lena - 1) + 1)
print(summ)


__author__ = 'artbataev'
n = int(input())
countDig = 0
power10 = 0
count = 0
while count + 9 * 10 ** power10 <= n:
	count += 9 * 10 ** power10
	countDig += (power10 + 1) * 9 * 10 ** power10
	power10 += 1
if count < n:
	countDig += (power10 + 1) * (n - count)
	count = n
print(countDig)


n = input()
l = len(n)
n = int(n)
s = '1'
for _ in range(l - 1):
	s += '0'
s = int(s)
ans = 0
while l > 1:
	temp = n - s + 1
	ans += temp * l
	n -= temp
	l -= 1
	s = s // 10
print(ans + n)


import math
n = int(input())
k = int(math.log10(n)) + 1
count = 0
for x in range(1, k + 1):
	if x == k:
		count += k * (n + 1 - 10 ** (k - 1))
	else:
		count += x * (10 ** x - 10 ** (x - 1))
print(count)


n = int(input())
res = 0
akt = n
while True:
	below = 0
	while below < akt:
		below *= 10
		below += 9
	below -= 9
	below = below // 10
	res += len(str(akt)) * (akt - below)
	akt = below
	if akt == 0:
		break
print(res)


n = int(input())
idx = 1
sum = 0
while True:
	number = 10 ** idx
	if n < number:
		sum += (n - 10 ** (idx - 1) + 1) * idx
		break
	else:
		sum += 9 * 10 ** (idx - 1) * idx
	idx += 1
print(sum)


n = int(input())
maxn = 15
d = [9]
s = '9'
for i in range(maxn):
	s += '0'
	d.append(int(s))
i = 0
sum = 0
ans = 9
if n <= 9:
	print(n)
else:
	while True:
		if ans < n:
			sum += d[i] * (i + 1)
			i = i + 1
		else:
			sum += (n - anshelp) * (i + 1)
			break
		anshelp = 1
		anshelp *= ans
		ans += d[i]
	print(sum)


a = int(input())
for i in range(1, 11):
	if a < 10 ** i:
		break
answer = 10 ** (i - 1) - 1
for j in range(i - 1):
	answer += int(j * 90 * 10 ** (j - 1))
print(answer + i * (a - 10 ** (i - 1) + 1))


n = int(input())
res = 0
for i in range(100):
	t = 9 * 10 ** i
	if n <= t:
		res += (i + 1) * n
		break
	res += (i + 1) * t
	n -= t
print(res)


n = int(input())
sum = 0
k = n
i = 0
while k > 0:
	sum += 10 ** i
	i += 1
	k = k // 10
print(i * (n + 1) - sum)


n = str(input())
n1 = int(n)
n2 = list(n)
i = len(n2)
c = 0
while i >= 2:
	t1 = n1 - 10 ** (i - 1)
	c += (t1 + 1) * i
	n1 = 10 ** (i - 1) - 1
	i -= 1
if int(n) <= 9:
	c += int(n)
else:
	c += 9
print(c)


n = int(input())
t = 0
a = n
m = 0
ab = n
h = 1
while 10 ** h <= n:
	h = h + 1
for i in range(1, h):
	ti = 10 ** i - 10 ** (i - 1)
	t = t + ti * i
t = t + (n - 10 ** (h - 1) + 1) * h
print(t)


n = int(input())
if n < 10:
	print(n)
else:
	m = str(n)
	v = '1' + (len(m) - 1) * '0'
	j = m[0] + (len(m) - 1) * '0'
	m = m[1:]
	b = int(m)
	b = (len(m) + 1) * b
	v = int(v)
	j = int(j)
	d = (j - v) * (len(m) + 1)
	i = len(m)
	t = i + b + 10 + d
	while v > 10:
		t += (v - v / 10) * i
		i -= 1
		v /= 10
	print(int(t))


def solve():
	n = int(input())
	orders = 0
	nc = n
	while nc:
		orders += 1
		nc //= 10
	ans = orders * (1 + n - 10 ** (orders - 1))
	for i in range(1, orders):
		diff = 10 ** i - 10 ** (i - 1)
		ans += diff * i
	return ans
print(solve())


n = int(input())
i = 1
nd = 0
while 10 ** i <= n:
	nd += (10 ** i - 10 ** (i - 1)) * i
	i += 1
nd += (1 + n - 10 ** (i - 1)) * i
print(nd)


import time
n = input()
start = time.time()
k = len(n)
ans = k * (int(n) + 1 - 10 ** (k - 1))
while k > 1:
	k -= 1
	ans += k * 9 * 10 ** (k - 1)
print(ans)
finish = time.time()


__author__ = 'Sandi'
import sys
inp = sys.stdin.read()
n = int(inp)
if n < 10:
	res = n
elif n > 9 and n < 100:
	res = 9 + (n - 10 + 1) * 2
elif n > 99 and n < 1000:
	res = 189 + (n - 100 + 1) * 3
elif n > 999 and n < 10000:
	res = 2889 + (n - 1000 + 1) * 4
elif n > 9999 and n < 100000:
	res = 38889 + (n - 10000 + 1) * 5
elif n > 99999 and n < 1000000:
	res = 488889 + (n - 100000 + 1) * 6
elif n > 999999 and n < 10000000:
	res = 5888889 + (n - 1000000 + 1) * 7
elif n > 9999999 and n < 100000000:
	res = 68888889 + (n - 10000000 + 1) * 8
elif n > 99999999 and n < 1000000000:
	res = 788888889 + (n - 100000000 + 1) * 9
elif n > 999999999 and n < 10000000000:
	res = 8888888889 + (n - 1000000000 + 1) * 10
print(res)


n = int(input())
ans = 0
for i in range(10):
	ans += (i + 1) * max(0, min(n + 1, 10 ** (i + 1)) - 10 ** i)
print(ans)


numero = input()
cont = 0
tamanho = len(numero)
numero = int(numero)
if numero < 10:
	print(numero)
else:
	cont += int('{}{}9'.format(tamanho - 2 if tamanho > 2 else '', '8' * (tamanho - 2) if tamanho > 2 else ''))
	cont += (numero - int('9' * (tamanho - 1))) * tamanho
	print(cont)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())

def f(n):
	if n < 10:
		return n
	i = 0
	while 10 ** i <= n:
		i += 1
	i -= 1
	ans = 0
	for j in range(1, i + 1):
		ans += 9 * 10 ** (j - 1) * j
	ans += (n - 10 ** i + 1) * (i + 1)
	return ans
print(f(N))


n = int(input())
ch = str(n)
x = len(ch)
if x == 1:
	print(n)
else:
	l = 0
	while x > 1:
		x -= 1
		t = pow(10, x) - 1
		c = n - t
		l = l + c * (x + 1)
		n = n - c
	print(l + 9)


n = input().rstrip()
k = len(n)
print(sum((9 * i * 10 ** (i - 1) for i in range(1, k))) + k * (int(n) - 10 ** (k - 1) + 1))


import sys
from math import log10
input = sys.stdin.readline
x = int(input())
y = int(log10(x)) + 1
li = [0, 1, 11, 111, 1111, 11111, 111111, 1111111, 11111111, 111111111, 1111111111]
print(y * (x + 1) - li[y])


a = int(input())
ra = len(str(a))
m = 0
for i in range(ra):
	m += 9 * 10 ** (i - 1) * i
m += (a - 10 ** (ra - 1) + 1) * ra
print(int(m))


n = int(input())
ans = 0
for i in range(10):
	level = 10 ** i * 9
	ans += min(n, level) * (i + 1)
	n -= level
	if n < 1:
		break
print(ans)


withFile = 0
if withFile == 1:
	fin = open('input.txt', 'r')
	fout = open('output.txt', 'w')

def getl():
	if withFile == 0:
		return input()
	else:
		return fin.readline()

def printl(s):
	if withFile == 0:
		print(s)
	else:
		fout.write(str(s))

def get_arr():
	x = getl().split(' ')
	if x[-1] == '':
		x = x[:-1]
	return list(map(int, x))
n = get_arr()
n = n[0]
f = [pow(10, i) - pow(10, i - 1) for i in range(1, 50)]
nl = len(str(n))
ans = (n - pow(10, nl - 1) + 1) * nl
for i in range(nl - 1):
	ans += f[i] * (i + 1)
printl(ans)
if withFile == 1:
	fin.close()
	fout.close()


n = int(input())
if n == 1000000000:
	print('8888888899')
	exit(0)
for i in range(1, 10):
	if n < 10 ** i:
		ans = i * (n + 1) - int('1' * i)
		print(ans)
		exit(0)


n = int(input())
sum = 0
exponent = len(str(n)) - 1
while n > 9:
	m = n - 10 ** exponent + 1
	sum += (exponent + 1) * m
	n -= m
	exponent -= 1
sum += n
print(sum)


import sys
import math
input = sys.stdin.readline
n = int(input())
count = 0
i = 1
while i <= n:
	count += n - i + 1
	i = i * 10
print(count)


__author__ = 'artyom'

def main():
	n = read()
	i = 9
	p = 1
	s = 0
	while n > 0:
		k = i if n >= i else n
		n -= k
		s += k * p
		i *= 10
		p += 1
	return s

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
write(main())


n = int(input())
v = 0
i = 1
while n >= 10 ** i:
	if i == 1:
		v += 9
	else:
		v += (10 ** i - 10 ** (i - 1)) * i
	i += 1
x = n - 10 ** (i - 1) + 1
v += i * x
print(v)


import sys

def fastio():
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var, sep=' ', end='\n'):
	print(*var, file=sys.stderr, end=end, sep=sep)
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
(n,) = I()
d = [int('9' * i) for i in range(1, 11)]
ans = 0
for (j, i) in enumerate(d, 1):
	if i <= n:
		ans += j * 9 * 10 ** (j - 1)
	else:
		ans += j * (n - i // 10)
		break
print(ans)


a = int(input())
deg = 1
k = 0
while 10 ** (deg - 1) <= a:
	k += a - 10 ** (deg - 1) + 1
	deg += 1
print(k)


n = int(input())
l = len(str(n))
print((n + 1) * l - (10 ** l - 1) // 9)


n = int(input())
m = 1
last = '9'
first = '1'
letters = 0
while n > int(last):
	letters += (int(last) - int(first) + 1) * m
	last += '9'
	first += '0'
	m += 1
letters += (n - int(first) + 1) * m
print(letters)


N = int(input())
low = 1
high = 10
res = 0
digit = 1
while True:
	if high > N:
		high = N + 1
	res += (high - low) * digit
	if high == N + 1:
		break
	high *= 10
	low *= 10
	digit += 1
print(res)


n = int(input())
amountOfDigits = len(str(n))
cnt = 0
a = []
for i in range(amountOfDigits):
	a.append(10 ** i)
for i in range(amountOfDigits - 1, -1, -1):
	cnt += (n - a[i] + 1) * len(str(a[i]))
	n = a[i] - 1
print(cnt)


n = input()
k = 9
l = len(n)
if l == 1:
	print(n)
else:
	c = (int(n) - int('9' * (l - 1))) * l
	for i in range(l - 1):
		c += k * (i + 1)
		k *= 10
	print(c)


a = int(input())
resp = 0
if a > 999999999:
	resp += (a - 999999999) * 10
	a = 999999999
if a > 99999999:
	resp += (a - 99999999) * 9
	a = 99999999
if a > 9999999:
	resp += (a - 9999999) * 8
	a = 9999999
if a > 999999:
	resp += (a - 999999) * 7
	a = 999999
if a > 99999:
	resp += (a - 99999) * 6
	a = 99999
if a > 9999:
	resp += (a - 9999) * 5
	a = 9999
if a > 999:
	resp += (a - 999) * 4
	a = 999
if a > 99:
	resp += (a - 99) * 3
	a = 99
if a > 9:
	resp += (a - 9) * 2
	a = 9
if a <= 9:
	resp += a
print(resp)


n = int(input())
x = 0
lll = '1' * (len(list(str(n))) - 1)
for i in range(1, len(list(str(n)))):
	x += i * 9 * 10 ** (i - 1)
if len(list(str(n))) != 1:
	print(x + (i + 1) * (n - 9 * int(lll)))
else:
	print(n)


n = int(input())
ans = 0
i = 1
while i <= n:
	if i * 10 <= n:
		ans += len(str(i)) * i * 9
	else:
		ans += (n - i + 1) * len(str(i))
	i *= 10
print(ans)


from math import log10
from math import floor
n = int(input())
nb = (n + 1) * floor(log10(10 * n)) - (10 ** floor(log10(10 * n)) - 1) / (10 - 1)
print(int(nb))


n = int(input())
ans = 0
z = len(str(n))
while n >= 1:
	x = 10 ** (z - 1)
	ans += (n - x + 1) * len(str(n))
	n = x - 1
	z -= 1
print(ans)


n = int(input())
temp = n
count = 0
while temp > 0:
	count += 1
	temp = temp // 10
if count > 1:
	temp = 9
	ans = 0
	for i in range(1, count):
		ans += temp * i
		temp *= 10
	ans += (n + 1 - 10 ** (count - 1)) * count
else:
	ans = n
print(ans)


n = int(input())

def dig(a):
	i = 0
	while a >= 1:
		i = i + 1
		a = a // 10
	return i
result = 0
digit = dig(n)
r = 1
while r < digit:
	result = result + 9 * 10 ** (r - 1) * r
	r = r + 1
last = n - 10 ** (digit - 1) + 1
result = last * digit + result
print(result)


books = int(input())
f = 9
multiplier = 1
total = 0
while True:
	books -= f
	total += f * multiplier
	if books < 0:
		total += books * multiplier
		break
	f *= 10
	multiplier += 1
print(total)


n = int(input())
if n < 10:
	print(n)
else:
	answer = 9
	curdigits = 2
	nexttenpower = 100
	prevtenpower = 10
	while n > nexttenpower - 1:
		answer = answer + curdigits * (nexttenpower - prevtenpower)
		curdigits = curdigits + 1
		prevtenpower = nexttenpower
		nexttenpower = nexttenpower * 10
	answer = answer + (n - prevtenpower + 1) * curdigits
	print(answer)


n = int(input())
(cur, ans) = (1, 0)
while cur <= n:
	cur *= 10
	if cur > n:
		ans += (n - cur // 10 + 1) * len(str(cur // 10))
	else:
		ans += (cur - cur // 10) * len(str(cur // 10))
print(ans)


n = input()
k = len(n)
n = int(n)
h = 0
for i in range(k):
	h += (i + 1) * 9 * 10 ** i
h += k * (n - 10 ** k + 1)
print(h)


n = int(input())
cnt = n
if n > 9:
	cnt += n - 9
if n > 99:
	cnt += n - 99
if n > 999:
	cnt += n - 999
if n > 9999:
	cnt += n - 9999
if n > 99999:
	cnt += n - 99999
if n > 999999:
	cnt += n - 999999
if n > 9999999:
	cnt += n - 9999999
if n > 99999999:
	cnt += n - 99999999
if n > 999999999:
	cnt += n - 999999999
print(cnt)


n = input()
sum = 0
k = len(n)
for i in range(1, k):
	sum += 9 * 10 ** (i - 1) * i
w = (int(n) - pow(10, k - 1) + 1) * k
print(sum + w)


n = input()
l = int(n)
ones = '1' * len(n)
print(len(n) * (l + 1) - int(ones))


nstr = input()
n = int(nstr)
ans = (n + 1) * len(nstr)
ans -= int('1' * len(nstr))
print(ans)


a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
aa = [9, 90, 900, 9000, 90000, 900000, 9000000, 90000000, 900000000, 9000000000]
n = int(input())
i = 0
ans = 0
while n > 0:
	if n >= aa[i]:
		ans += a[i] * aa[i]
		n = n - aa[i]
		i += 1
	else:
		ans += n * a[i]
		n = 0
print(ans)


n = int(input())
ch = str(n)
x = len(ch)
r = 0
if n < 10:
	print(n)
else:
	while x > 1:
		r = r + x * (n - (10 ** (x - 1) - 1))
		n = 10 ** (x - 1) - 1
		x -= 1
	print(r + 9)


def editor():
	import sys
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	N = input()
	if len(N) == 1:
		print(N)
		return
	n = int(N)
	ans = 0
	for i in range(len(N) - 1):
		ans += (i + 1) * 9 * 10 ** i
	tem = n - 10 ** (len(N) - 1)
	ans += (tem + 1) * len(N)
	print(ans)
solve()


def __starting_point():
	n_books = int(input())
	x = 0
	length = 1
	while n_books > 10 ** length - 1:
		x += (10 ** length - 10 ** (length - 1)) * length
		length += 1
	x += (n_books - 10 ** (length - 1) + 1) * length
	print(x)
__starting_point()


n = int(input())
g = [0]
kc = 0
for i in range(9):
	r = 9 * 10 ** kc * (kc + 1)
	kc += 1
	g.append(r + g[-1])
k = n
c = 0
while k != 0:
	k = k // 10
	c += 1
otv = g[c - 1]
otv += (n - 10 ** (c - 1) + 1) * c
print(otv)


n = int(input())
if n <= 9:
	print(n)
else:
	le = len(str(n))
	s = ''
	req = 0
	for k in range(1, le):
		s += str(k)
	print(n * le - int(s) * 9)


n = input()
l = len(n)
big = int(''.join([n[i] if i == 0 else '0' for i in range(0, l)]))
small = int(n[1:l]) if len(n[1:l]) > 0 else 0
d = 0
for i in range(-1, -l, -1):
	d += 9 * 10 ** (-i - 1) * -i
d += (small + 1) * l
d += (big - 10 ** (l - 1)) * l
print(d)


n = input()
digits = len(n)
n = int(n)
sum = 0
for i in range(1, digits):
	sum += i * 10 ** (i - 1) * 9
sum += digits * (n - 10 ** (digits - 1) + 1)
print(sum)


n = int(input())
nrDigits = 0
limit1 = 1
limit2 = 9
digit = 1
while n > limit2:
	nrDigits += (limit2 - limit1 + 1) * digit
	limit1 *= 10
	limit2 = limit2 * 10 + 9
	digit += 1
nrDigits += (n - limit1 + 1) * digit
print(nrDigits)


n = input()
k = len(n)
x = 0
t = []
for i in range(11):
	x += 9 * 10 ** (i - 1) * i
	t.append(int(x))
p = str(int(n) - 10 ** (k - 1) + 1)
ans = t[k - 1] + int(p) * k
print(int(ans))


n = input()
le = len(n)
(ans, l1, p, a) = (0, 1, 0, 0)
while l1 <= int(n):
	ans += (l1 - 1 - p) * a
	p = l1 - 1
	l1 *= 10
	a += 1
l1 = l1 // 10
ans += (int(n) - l1 + 1) * a
print(ans)


a = [0, 9, 108, 1107, 11106, 111105, 1111104, 11111103, 111111102, 1111111101]
n = int(input())
x = n
c = 0
while n >= 1:
	n /= 10
	c += 1
print(c * x - a[c - 1])


n = int(input())
cnt = 0
i = 1
while i <= n + 1:
	cnt += n - i + 1
	i = i * 10
print(cnt)


n = input()
n_digits = len(n)
n = int(n)
result = 0
for i in range(1, n_digits):
	result += i * 9 * 10 ** (i - 1)
counted = 10 ** (n_digits - 1) - 1
result += n_digits * (n - counted)
print(result)


ch = str(input())
n = int(ch)
res = 0
if len(ch) > 1:
	for i in range(1, len(ch)):
		res += i * (10 ** i - 10 ** (i - 1))
res += len(ch) * (n + 1 - 10 ** (len(ch) - 1))
print(res)


numero = input()
if int(numero) > 9:
	a = ''
	i = 1
	aux = 9
	while True:
		if i > len(numero) - 1:
			break
		if i == len(numero) - 1:
			aux += (int(numero) - (10 ** i - 1)) * (i + 1)
		if i < len(numero) - 1:
			aux += (10 ** (i + 1) - 10 ** i) * (i + 1)
		i += 1
else:
	aux = int(numero)
	i = 0
print(aux)


n = int(input())
res = 0
temp_sum = 0
threshold = 10
temp = 9
count = 1
while True:
	if n >= threshold:
		res += temp * count
		temp_sum += temp
		threshold *= 10
		temp *= 10
		count += 1
	else:
		res += (temp - (temp + temp_sum - n)) * count
		break
print(res)


N_str = input()
N = int(N_str)

def num_overlaps(a, b, c, d):
	lb = max(a, c)
	ub = min(b, d)
	return len(range(lb, ub + 1))

def range_with_digits(d):
	return (10 ** (d - 1), 10 ** d - 1)
ans = 0
for d in range(1, len(N_str) + 1):
	no = num_overlaps(1, N, *range_with_digits(d))
	ans += no * d
print(ans)


n = int(input())
d = 0
while n / 10 ** d >= 1:
	d += 1
cif = 0
for j in range(1, d):
	cif += j * 9 * 10 ** (j - 1)
cif += d * (n - 10 ** (d - 1) + 1)
print(cif)


n = int(input())
prev_step = 0
cur_step = 9
_sum = 0
count = 1
while n > cur_step:
	_sum += count * (cur_step - prev_step)
	prev_step = cur_step
	cur_step = cur_step * 10 + 9
	count += 1
_sum += count * (n - prev_step)
print(_sum)


import math
a = int(input())
nn = int(a)
m = int(0)
while nn > 0:
	nn = int(nn) / 10
	m = m + int(1)
nine1 = int(int(math.pow(10, m - 1)) / 10 - 1)
nine2 = int(0)
while nine1 > 0:
	nine2 = nine2 + int(nine1)
	nine1 = int(nine1) / 10
ru = int(a * (m - 1) - nine2)
print(ru)


q = int(input())
n = len(str(q))
t = 0
x = 0
for i in range(n - 1):
	t = t + 9 * pow(10, i) * (i + 1)
	x = x + 9 * pow(10, i)
m = (q - x) * n + t
print(m)


import sys
import random
from math import log2, log, ceil
input = sys.stdin.readline

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a > 0:
		return gcd(b % a, a)
	return b

def primefs(n):
	if n == 1:
		return 1
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	while x != link[x]:
		x = link[x]
	return x

def union(x, y, size, link):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().split()))
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
n = int(input())
ans = 0
i = 0
while n >= 9 * 10 ** i:
	n -= 9 * 10 ** i
	ans += (i + 1) * 9 * 10 ** i
	i += 1
ans += (i + 1) * n
print(ans)


def main():
	s = input()
	(n, le) = (int(s), len(s))
	print((n + 1) * le - int('1' * le))
main()


books = int(input())
i = 1
res = 0
if books < 10:
	print(books)
else:
	while i <= 9:
		if books // pow(10, i) == 0:
			i -= 1
			break
		else:
			res += i * (9 * pow(10, i - 1))
		i += 1
	if i < 9:
		resto = books - pow(10, i)
		res += resto * (i + 1) + (i + 1)
	else:
		res += 10
	print(res)


n = int(input())
count = 0

def fun(l):
	n = 0
	while l > 1:
		n = n * 10 + 9
		l -= 1
	return n
l = len(str(n))
while n > 0:
	count += (n - fun(l)) * l
	n = fun(l)
	l -= 1
print(count)


import unittest
import sys
import re
import random

class Books:

	def __init__(self, args):
		self.args = args

	def lowest(self, num):
		return int(pow(10, num - 1))

	def highest(self, num):
		return self.lowest(num + 1) - 1

	def calculate(self):
		result = 0
		for n in range(11):
			h = self.highest(n)
			l = self.lowest(n)
			if self.args >= l:
				if self.args >= h:
					result += n * (h - l + 1)
				else:
					result += n * (self.args - l + 1)
		return result

def decode_inputs(inputs):
	args = int(inputs)
	return args

def calculate(inputs):
	return Books(decode_inputs(inputs)).calculate()

def main():
	inputs = input()
	print(calculate(inputs))

class unitTests(unittest.TestCase):

	def test_decode_inputs(self):
		self.assertEqual(decode_inputs('2'), 2)

	def test_Books_class__basic_functions(self):
		d = Books(1)
		self.assertEqual(d.args, 1)
		self.assertEqual(d.lowest(1), 1)
		self.assertEqual(d.lowest(3), 100)
		self.assertEqual(d.highest(2), 99)

	def test_calculate(self):
		self.assertEqual(calculate('13'), 17)
		self.assertEqual(calculate('20'), 31)
if sys.argv[-1] == '-ut':
	unittest.main(argv=[' '])
main()


n = input()
L = len(n)
n = int(n)
r = 0
for i in range(1, L):
	r += 9 * 10 ** (i - 1) * i
print(r + (n - 10 ** (L - 1) + 1) * L)


b = int(input())
t = 0
for x in range(9, -1, -1):
	if b >= 10 ** x:
		d = 1 + b - 10 ** x
		t += d * (x + 1)
		b = 10 ** x - 1
print(t)


numb = input()
summ = 0
for i in range(1, len(numb)):
	summ += i * 9 * 10 ** (i - 1)
summ += len(numb) * (int(numb) - 10 ** (len(numb) - 1) + 1)
print(summ)


n = int(input())
ans = n
nb = 1
for _ in range(10):
	nb *= 10
	if n >= nb:
		ans += n + 1 - nb
print(ans)


x = int(input())
an = 0
while x > 0:
	d = x - int('1' + '0' * (len(str(x)) - 1)) + 1
	an += d * len(str(x))
	x -= d
print(an)


n = h = int(input())
p = q = 0
for i in range(1, len(str(n)) + 1):
	m = min(int('9' + '0' * (i - 1)), n)
	p = p + m * i
	q += m
	n = h - q
print(p)


n = input()
s = len(n)
q = 0
if s > 2:
	for c in range(s - 1):
		v = int('9' + c * '0')
		q += v * (c + 1)
	k = int(n) - (int('1' + (s - 1) * '0') - 1)
	q += k * s
elif s == 2:
	q += 9
	k = int(n) - 9
	q += k * s
else:
	q += s * int(n)
print(q)


n = input()
d = len(n)
ans = 0
while d > 0:
	if d == len(n):
		ans += (int(n) - int('1' + '0' * (d - 1)) + 1) * d
	else:
		ans += (int('9' * d) - int('1' + '0' * (d - 1)) + 1) * d
	d -= 1
print(ans)


def f(n):
	n1 = n
	r = 0
	t = 0
	for i in range(0, 15):
		if n >= 10 ** i:
			r = r + n - 10 ** i + 1
	return r
n = int(input())
print(f(n))


R = lambda : list(map(int, input().split()))
n = R()[0]
ans = 0
cnt = 1
mul = 9
k = 9
while k <= n:
	k = k * 10 + 9
	ans += mul * cnt
	mul *= 10
	cnt += 1
ans += (n - 10 ** (cnt - 1) + 1) * cnt
print(ans)


entrada = input()
soma = 0
tamanho = len(entrada)
if tamanho == 1:
	print(entrada)
else:
	a = int(entrada)
	b = 10 ** (tamanho - 1) - 1
	c = (a - b) * tamanho
	soma += c
	for i in range(tamanho - 1):
		soma += 9 * 10 ** i * (i + 1)
	print(soma)


s = input()
n = int(s)
l = len(s) - 1
ans = 0
while l:
	num = int('9' * l)
	ans += (n - num) * (l + 1)
	n = num
	l -= 1
print(ans + n)


n = int(input())
co = 0
m = 1
while m:
	x = 0
	if n >= 1 and n <= 9:
		co = co + n
		m = 0
	if n >= 10 and n <= 99:
		x = x + (n - 10) + 1
		y = x
		x = x * 2
		co = co + x
		n = n - y
	if n >= 100 and n <= 999:
		x = x + (n - 100) + 1
		y = x
		x = x * 3
		co = co + x
		n = n - y
	if n >= 1000 and n <= 9999:
		x = x + (n - 1000) + 1
		y = x
		x = x * 4
		co = co + x
		n = n - y
	if n >= 10000 and n <= 99999:
		x = x + (n - 10000) + 1
		y = x
		x = x * 5
		co = co + x
		n = n - y
	if n >= 100000 and n <= 999999:
		x = x + (n - 100000) + 1
		y = x
		x = x * 6
		co = co + x
		n = n - y
	if n >= 1000000 and n <= 9999999:
		x = x + (n - 1000000) + 1
		y = x
		x = x * 7
		co = co + x
		n = n - y
	if n >= 10000000 and n <= 99999999:
		x = x + (n - 10000000) + 1
		y = x
		x = x * 8
		co = co + x
		n = n - y
	if n >= 100000000 and n <= 999999999:
		x = x + (n - 100000000) + 1
		y = x
		x = x * 9
		co = co + x
		n = n - y
	if n == 1000000000:
		co = co + 10
		n = n - 1
print(co)


def no_of_digits(n):
	s = 9
	k = 1
	l = 9
	if n <= 9:
		return n
	else:
		n -= 9
		while n > 0:
			k += 1
			s = s * 10
			l += min(s, n) * k
			n -= min(s, n)
		return l
n = int(input())
print(no_of_digits(n))


def f(n, m):
	if n >= 10 ** (m + 1):
		return (10 ** (m + 1) - 10 ** m) * (m + 1) + f(n, m + 1)
	elif n >= 10 ** m:
		if m == 0:
			return n
		else:
			return (n - 10 ** m + 1) * (m + 1)
	else:
		return 0
print(f(int(input()), 0))


n = int(input())
p = n
c = 0
sum = 0
while 1:
	p //= 10
	c += 1
	if p is 0:
		break
	sum += 9 * 10 ** (c - 1) * c
sum += (n - 10 ** (c - 1) + 1) * c
print(sum)


n = int(input())
k = 0
z = 1
while z <= n:
	k += n - z + 1
	z *= 10
print(k)


n = int(input())
c = 0
n1 = n
while n > 0:
	c += 1
	n = n // 10
ans = 0
for i in range(1, c):
	ans += 10 ** (i - 1) * 9 * i
ans += (n1 - (10 ** (c - 1) - 1)) * c
print(ans)


x = int(input())
sum = 0
pow = 0
while 10 ** (pow + 1) <= x:
	pow += 1
sum = 10 ** pow * pow
sum += (x - 10 ** pow + 1) * (pow + 1)
for i in range(0, pow):
	sum -= 10 ** i
print(sum)


y = input()
n = int(y)
k = int(''.join(list(map(str, list(range(len(y)))))))
z = n * len(y) - 9 * k
print(z)


from math import *
n = int(input())
x = 0
y = floor(log10(n))
for i in range(y):
	x = x + (i + 1) * 9 * 10 ** i
x = x + (y + 1) * (n + 1 - 10 ** y)
print(int(x))