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.
The first line contains integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">9</sup>) — the number of books in the library.
def books(n):
    '''
    Params:
        n_books: int -- number of books, 1<= n_books <= 10^9

    Returns:
        int -- number of digits used to enumerate books

    ex 1:

    953

    for each full interval add # of elements for that bucket * bucket size
    1) n % 10 != 953 => 1 digit * (10)-10*0
    n % 100 != 953 => 2 digits * (100)-10*1
    2) n % 1000 == 953 => 3 digits * 953+1-10*10
    '''
    digs = 0
    for i in range(11):
        if n % (10 ** (i + 1)) != n:
            # 1)
            digs += (i + 1) * ((10 ** (i + 1)) - 10 ** i)
        else:
            # 2)
            digs += (i + 1) * (n + 1 - (10 ** i))
            return digs

print(books(int(input())))
