two=int(input())
ten=0

for i in range(two//10+1):
    j=int(i)
    ten+=two%(10*{j+1})*2^j
print(ten)