'''수 이어 쓰기 1'''
import sys
input = sys.stdin.readline
n = int(input())

answer = 0
start = 1
length = 1
while start <= n:
    end = start * 10 - 1
    if end > n: 
        end = n
    
    answer += (end - start + 1) * length
    start *= 10
    length += 1

print(answer)

a916a0d5ab501c69d89a44c1330fbfb97c2fb11b
<mask token>

<mask token>
while start <= n:
    end = start * 10 - 1
    if end > n:
        end = n
    answer += (end - start + 1) * length
    start *= 10
    length += 1
print(answer)

<mask token>
input = sys.stdin.readline
n = int(input())
answer = 0
start = 1
length = 1
while start <= n:
    end = start * 10 - 1
    if end > n:
        end = n
    answer += (end - start + 1) * length
    start *= 10
    length += 1
print(answer)

<mask token>
import sys
input = sys.stdin.readline
n = int(input())
answer = 0
start = 1
length = 1
while start <= n:
    end = start * 10 - 1
    if end > n:
        end = n
    answer += (end - start + 1) * length
    start *= 10
    length += 1
print(answer)

'''수 이어 쓰기 1'''
import sys
input = sys.stdin.readline
n = int(input())

answer = 0
start = 1
length = 1
while start <= n:
    end = start * 10 - 1
    if end > n: 
        end = n
    
    answer += (end - start + 1) * length
    start *= 10
    length += 1

print(answer)
