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: interview

Starter code:

Solutions:
hola = 0
a = int(input())
d = len(str(a))
k = 10**(d-1)
for i in range(1, d):
    hola += i * (10**(i-1)*9)

hola += d * (a-k+1)
print(hola)

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)

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


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())

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())
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())
ans = 0
A = [9 * 10 ** i for i in range(10)]
for i in range(10):
    if n <= A[i]:
        print(ans + n * (i + 1))
        break
    else:
        ans += A[i] * (i + 1)
        n -= A[i]


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))

from heapq import heapify, heappush, heappop
from collections import Counter, defaultdict, deque, OrderedDict
from sys import setrecursionlimit, maxsize
from bisect import bisect_left, bisect, insort_left, insort
from math import ceil, log, factorial, hypot, pi
from fractions import gcd
from copy import deepcopy
from functools import reduce
from operator import mul
from itertools import product, permutations, combinations, accumulate, cycle
from string import ascii_uppercase, ascii_lowercase, ascii_letters, digits, hexdigits, octdigits

prod = lambda l: reduce(mul, l)
prodmod = lambda l, mod: reduce(lambda x, y: mul(x,y)%mod, l)

def read_list(t): return [t(x) for x in input().split()]
def read_line(t): return t(input())
def read_lines(t, N): return [t(input()) for _ in range(N)]

N = read_line(int)
ans = 0
for i in range(len(str(N))):
    ans += N - 10**i + 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))


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()

__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)

def __starting_point():
    main()
__starting_point()

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))

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)



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)

def f(n):
    if n < 10:
        return n
    if n < 100:
        return 9 + 2 * (n - 9)
    if n < 1e3:
        return f(99) + 3 * (n - 99)
    if n < 1e4:
        return f(999) + 4 * (n - 999)
    if n < 1e5:
        return f(9999) + 5 * (n - 9999)
    if n < 1e6:
        return f(99999) + 6 * (n - 99999)
    if n < 1e7:
        return f(999999) + 7 * (n - 999999)
    if n < 1e8:
        return f(9999999) + 8 * (n - 9999999)
    if n < 1e9:
        return f(99999999) + 9 * (n - 99999999)
    return f(999999999) + 10 * (n - 999999999)

n = int(input())
print(f(n))


def xxx(n):
    total = 0
    curr = 9
    for i in range(n):
        total += curr * (i + 1)
        curr *= 10

    return total


def __starting_point():
    n = int(input())
    l = len(str(n))
    a = xxx(l - 1)
    b = (n - 10 ** (l - 1) + 1) * l
    print(a + b)
__starting_point()

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


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())
ans = 0
for i in range(1, len(str(n))):
    ans += 9 * i * (10 ** (i - 1))
ans += len(str(n)) * (n - (10 ** (len(str(n)) - 1)) + 1)
print(ans)

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
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, 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 = 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)