S = eval(input())

ans = 0

for i in range(2**(len(S)-1)):

    tmp = S[0]

    for j in range(len(S)-1):

        if i & (1 << j):

            tmp += "+"

        tmp += S[j+1]

    ans += eval(tmp)

print(ans)

import sys

stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)



i_i = lambda: int(i_s())

i_l = lambda: list(map(int, stdin.readline().split()))

i_s = lambda: stdin.readline().rstrip()



s = i_s()



ans = 0

for i in range(2**(len(s)-1)):

    tmp = s[0]

    for j in range(len(s)-1):

        if i & (1<<j):

            tmp += "+"

        tmp += s[j+1]

    ans += eval(tmp)



print(ans)
S = eval(input())
ans = 0
for i in range(2 ** (len(S) - 1)):
    tmp = S[0]
    for j in range(len(S) - 1):
        if i & (1 << j):
            tmp += "+"
        tmp += S[j + 1]
    ans += eval(tmp)
print(ans)

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**7)
i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()
s = i_s()
ans = 0
for i in range(2 ** (len(s) - 1)):
    tmp = s[0]
    for j in range(len(s) - 1):
        if i & (1 << j):
            tmp += "+"
        tmp += s[j + 1]
    ans += eval(tmp)
print(ans)

-S = eval(input()) +import sys + +stdin = sys.stdin +sys.setrecursionlimit(10**7) +i_i = lambda: int(i_s()) +i_l = lambda: list(map(int, stdin.readline().split())) +i_s = lambda: stdin.readline().rstrip() +s = i_s() -for i in range(2 ** (len(S) - 1)): -    tmp = S[0] -    for j in range(len(S) - 1): +for i in range(2 ** (len(s) - 1)): +    tmp = s[0] +    for j in range(len(s) - 1): -        tmp += S[j + 1] +        tmp += s[j + 1]