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.
ll=lambda:map(int,input().split())
t=lambda:int(input())
ss=lambda:input()
lx=lambda x:map(int,input().split(x))
#from math import log10 ,log2,ceil,factorial as fac,gcd
#from itertools import combinations_with_replacement as cs 
#from functools import reduce
#from bisect import bisect_right as br,bisect_left as bl
from collections import Counter
#from math import inf



       
#for _ in range(t()):
def f():
    n=t()
    s=0
    
    s+=min(9,n)
    
    if 9<n:
        s+=2*min(n-9,100)
        
    if 99<n:
        s+=3*min(n-99,1000)
    if 999<n:
        s+=4*min(n-999,10000)
    if 9999<n:
        s+=5*min(n-9999,100000)
    if 99999<n:
        s+=6*min(n-99999,10**6)
    if 999999<n:
        s+=7*min(n-999999,10**7)
    if 9999999<n:
        s+=8*min(n-9999999,10**8)
    if 99999999<n:
        s+=9*min(n-99999999,10**9)
    print(s)   
    
'''
1 10
2 9
3 8
4 7
6 5
100 101 102 103 104 105 106 107 108 109 110 111 112
39
1

'''
    

    

    
    
    
f()
