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,90)
        
    if 99<n:
        s+=3*min(n-99,990)
    if 999<n:
        s+=4*min(n-999,10*4-10)
    if 9999<n:
        s+=5*min(n-9999,10**5-10)
    if 99999<n:
        s+=6*min(n-99999,10**6-10)
    if 999999<n:
        s+=7*min(n-999999,10**7-10)
    if 9999999<n:
        s+=8*min(n-9999999,10**8-10)
    if 99999999<n:
        s+=9*min(n-99999999,10**9-10)
    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
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
'''
    

    

    
    
    
f()
