<filename>problem/01000~09999/01748/1748.py3.py
N = int(input())
digit = 0
count = 0
T = N//10

while T>0:
  digit+=1
  count+=digit*9*(10**(digit-1))
  T//=10

start_num = 10**digit
count += (digit+1) * (N - start_num + 1)
print(count)
<filename>problem/01000~09999/01748/1748.py3.py
N = int(input())
digit = 0
count = 0
T = N//10

while T>0:
  digit+=1
  count+=digit*9*(10**(digit-1))
  T//=10

start_num = 10**digit
count += (digit+1) * (N - start_num + 1)
print(count)