S = eval(input())

n = len(S)

if n == 1:

    print(S)

    quit()

import itertools as it

def sum_insert(x,S): 

    z = list(zip(S,x))

    L = []

    for x in z:

        L.append(x[0])

        if x[1] == '1':

            L.append('+')

    L.append(S[-1])

    s = ''.join(L)

    return eval(s)

ans = 0

variation = []

for i in range (2**(n-1)):

    variation.append(format(i,'b').zfill(n-1))



for x in variation:

    ans += sum_insert(x,S)

print(ans)





S = eval(input())

cand = [0 for _ in range(2 **(len(S) - 1))]

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

    now = 0

    tmp = []

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

        if i & (1 << k):

            tmp.append(S[now:k + 1])

            now = k + 1

    tmp.append(S[now:])

    for x in tmp:

        if x == '':

            continue

        else:

            cand[i] += int(x)

print((sum(cand)))

S = eval(input())
n = len(S)
if n == 1:
    print(S)
    quit()
import itertools as it


def sum_insert(x, S):
    z = list(zip(S, x))
    L = []
    for x in z:
        L.append(x[0])
        if x[1] == "1":
            L.append("+")
    L.append(S[-1])
    s = "".join(L)
    return eval(s)


ans = 0
variation = []
for i in range(2 ** (n - 1)):
    variation.append(format(i, "b").zfill(n - 1))
for x in variation:
    ans += sum_insert(x, S)
print(ans)

S = eval(input())
cand = [0 for _ in range(2 ** (len(S) - 1))]
for i in range(2 ** (len(S) - 1)):
    now = 0
    tmp = []
    for k in range(len(S) - 1):
        if i & (1 << k):
            tmp.append(S[now : k + 1])
            now = k + 1
    tmp.append(S[now:])
    for x in tmp:
        if x == "":
            continue
        else:
            cand[i] += int(x)
print((sum(cand)))

-n = len(S) -if n == 1: -    print(S) -    quit() -import itertools as it - - -def sum_insert(x, S): -    z = list(zip(S, x)) -    L = [] -    for x in z: -        L.append(x[0]) -        if x[1] == "1": -            L.append("+") -    L.append(S[-1]) -    s = "".join(L) -    return eval(s) - - -ans = 0 -variation = [] -for i in range(2 ** (n - 1)): -    variation.append(format(i, "b").zfill(n - 1)) -for x in variation: -    ans += sum_insert(x, S) -print(ans) +cand = [0 for _ in range(2 ** (len(S) - 1))] +for i in range(2 ** (len(S) - 1)): +    now = 0 +    tmp = [] +    for k in range(len(S) - 1): +        if i & (1 << k): +            tmp.append(S[now : k + 1]) +            now = k + 1 +    tmp.append(S[now:]) +    for x in tmp: +        if x == "": +            continue +        else: +            cand[i] += int(x) +print((sum(cand)))