s=input()

t=len(s)-1

tmp=2**t

ans=0

for i in range(tmp):

    p=bin(i)[2:]

    p='0'*(t-len(p))+p

    x=''

    for j,k in enumerate(s):

        x+=k

        if j!=t and p[j]=='1':

            x+='+'

    ans+=eval(x)

print(ans)
#!/usr/bin/env python3



s=eval(input())



ans=tmp=0

t=len(s)



for i in range(1<<(t-1)):

#    print(i)

    tmp=int(s[0])

    for j in range(t-1):

        if (i & (1<<j)):

            tmp*=10

            tmp+=int(s[j+1])

        else:

            ans+=tmp

            tmp=int(s[j+1])

    ans+=tmp

print(ans)
s = input()
t = len(s) - 1
tmp = 2**t
ans = 0
for i in range(tmp):
    p = bin(i)[2:]
    p = "0" * (t - len(p)) + p
    x = ""
    for j, k in enumerate(s):
        x += k
        if j != t and p[j] == "1":
            x += "+"
    ans += eval(x)
print(ans)

#!/usr/bin/env python3
s = eval(input())
ans = tmp = 0
t = len(s)
for i in range(1 << (t - 1)):
    #    print(i)
    tmp = int(s[0])
    for j in range(t - 1):
        if i & (1 << j):
            tmp *= 10
            tmp += int(s[j + 1])
        else:
            ans += tmp
            tmp = int(s[j + 1])
    ans += tmp
print(ans)

-s = input() -t = len(s) - 1 -tmp = 2**t -ans = 0 -for i in range(tmp): -    p = bin(i)[2:] -    p = "0" * (t - len(p)) + p -    x = "" -    for j, k in enumerate(s): -        x += k -        if j != t and p[j] == "1": -            x += "+" -    ans += eval(x) +#!/usr/bin/env python3 +s = eval(input()) +ans = tmp = 0 +t = len(s) +for i in range(1 << (t - 1)): +    #    print(i) +    tmp = int(s[0]) +    for j in range(t - 1): +        if i & (1 << j): +            tmp *= 10 +            tmp += int(s[j + 1]) +        else: +            ans += tmp +            tmp = int(s[j + 1]) +    ans += tmp