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.
'''
count = 0
n, m = map(int, input().split())
while n > 0:
    count+=1
    n-=1
    if count % m == 0:
        n+=1

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