https://www.acmicpc.net/problem/1748
def zero(n): z=1 if n<=0: z=0 else: for i in range(1,n): z*=10 return z k=input() n=int(k) len=len(k) num=0 while n>0: num+=(n-zero(len)+1)*len n=zero(len)-1 len-=1 print(num)