import itertools

nums = eval(input())

index = list(range(1, len(nums)))

def resolve(i):

    t = list(nums)

    for j in reversed(i): t.insert(j, "+")

    return eval("".join(t))



print((sum([resolve(i) for i in itertools.chain(*[itertools.combinations(index, x) for x in range(len(index) + 1)])])))

import itertools



number = eval(input())

answer = int(number)

length = len(number)



empty = [""] * length

plus = ["+"] * length



results = []

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

    calc = ""

    for j in range(length - 1):

        calc += number[j]

        if i & 1:

            calc += "+"

        i >>= 1

    f = calc + number[-1]

    results.append(eval(f))

print((sum(results)))

import itertools

nums = eval(input())
index = list(range(1, len(nums)))


def resolve(i):
    t = list(nums)
    for j in reversed(i):
        t.insert(j, "+")
    return eval("".join(t))


print(
    (
        sum(
            [
                resolve(i)
                for i in itertools.chain(
                    *[itertools.combinations(index, x) for x in range(len(index) + 1)]
                )
            ]
        )
    )
)

import itertools

number = eval(input())
answer = int(number)
length = len(number)
empty = [""] * length
plus = ["+"] * length
results = []
for i in range(2 ** (length - 1)):
    calc = ""
    for j in range(length - 1):
        calc += number[j]
        if i & 1:
            calc += "+"
        i >>= 1
    f = calc + number[-1]
    results.append(eval(f))
print((sum(results)))

-nums = eval(input()) -index = list(range(1, len(nums))) - - -def resolve(i): -    t = list(nums) -    for j in reversed(i): -        t.insert(j, "+") -    return eval("".join(t)) - - -print( -    ( -        sum( -            [ -                resolve(i) -                for i in itertools.chain( -                    *[itertools.combinations(index, x) for x in range(len(index) + 1)] -                ) -            ] -        ) -    ) -) +number = eval(input()) +answer = int(number) +length = len(number) +empty = [""] * length +plus = ["+"] * length +results = [] +for i in range(2 ** (length - 1)): +    calc = "" +    for j in range(length - 1): +        calc += number[j] +        if i & 1: +            calc += "+" +        i >>= 1 +    f = calc + number[-1] +    results.append(eval(f)) +print((sum(results)))