n=list(eval(input()))

k=len(n)-1



x=0

for i in range(2**k):

    v=[""]*k

    for j in range(k):

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

            v[j]="+"

    ans=""

    for a,b in zip(n,v+[""]):

        ans+=(a+b)

    x+=eval(ans)

print(x)
s=list(eval(input()))

n=len(s)



def dfs(i,f):

    if i==n-1:

        return sum(list(map(int,f.split("+"))))

    

    return dfs(i+1,f+s[i+1]) + dfs(i+1, f + "+" + s[i+1])





print((dfs(0,s[0])))
n = list(eval(input()))
k = len(n) - 1
x = 0
for i in range(2**k):
    v = [""] * k
    for j in range(k):
        if (i >> j) & 1:
            v[j] = "+"
    ans = ""
    for a, b in zip(n, v + [""]):
        ans += a + b
    x += eval(ans)
print(x)

s = list(eval(input()))
n = len(s)


def dfs(i, f):
    if i == n - 1:
        return sum(list(map(int, f.split("+"))))
    return dfs(i + 1, f + s[i + 1]) + dfs(i + 1, f + "+" + s[i + 1])


print((dfs(0, s[0])))

-n = list(eval(input())) -k = len(n) - 1 -x = 0 -for i in range(2**k): -    v = [""] * k -    for j in range(k): -        if (i >> j) & 1: -            v[j] = "+" -    ans = "" -    for a, b in zip(n, v + [""]): -        ans += a + b -    x += eval(ans) -print(x) +s = list(eval(input())) +n = len(s) + + +def dfs(i, f): +    if i == n - 1: +        return sum(list(map(int, f.split("+")))) +    return dfs(i + 1, f + s[i + 1]) + dfs(i + 1, f + "+" + s[i + 1]) + + +print((dfs(0, s[0])))