S = eval(input())

N = len(S) - 1



def culc(string):

    string = list(string)

    digit = []

    prev = 0

    for i, s in enumerate(string):

        if s == "+":

            digit.append(int("".join(string[prev:i])))

            prev = i+1

        if i == len(string)-1:

            digit.append(int("".join(string[prev:])))

    return sum(digit)



SUM = 0

for bit in range(0, 1<<N):

    string = S

    for i in reversed(list(range(N))):

        if (bit>>i) & 1:

            string = string[:i+1] + "+" + string[i+1:]

    SUM += culc(string)  



print(SUM)     
import sys

input = sys.stdin.readline

sys.setrecursionlimit(10 ** 7)



S = input()[:-1]  # 改行をなくす

n = len(S) - 1  # +を入れる事ができる場所の数



# bit全探索

P = []

for bit in range(0, 1<<n):  # 00 ~ 11

    plus = [""] * n

    for j in range(n):

        if bit>>j & 1:

            plus[j] = "+"

    P.append(plus)







ans = 0

if n == 0:

    print((int(S)))

else:

    for plus in P:

        nums = []

        tmp = S

        pre = 0

        for i in range(n):

            if plus[i] == "+":

                nums.append(int(tmp[pre:i+1]))

                pre = i+1

            if i == n-1:

                nums.append(int(tmp[pre:]))

        ans += sum(nums)

    print(ans)

S = eval(input())
N = len(S) - 1


def culc(string):
    string = list(string)
    digit = []
    prev = 0
    for i, s in enumerate(string):
        if s == "+":
            digit.append(int("".join(string[prev:i])))
            prev = i + 1
        if i == len(string) - 1:
            digit.append(int("".join(string[prev:])))
    return sum(digit)


SUM = 0
for bit in range(0, 1 << N):
    string = S
    for i in reversed(list(range(N))):
        if (bit >> i) & 1:
            string = string[: i + 1] + "+" + string[i + 1 :]
    SUM += culc(string)
print(SUM)

import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**7)
S = input()[:-1]  # 改行をなくす
n = len(S) - 1  # +を入れる事ができる場所の数
# bit全探索
P = []
for bit in range(0, 1 << n):  # 00 ~ 11
    plus = [""] * n
    for j in range(n):
        if bit >> j & 1:
            plus[j] = "+"
    P.append(plus)
ans = 0
if n == 0:
    print((int(S)))
else:
    for plus in P:
        nums = []
        tmp = S
        pre = 0
        for i in range(n):
            if plus[i] == "+":
                nums.append(int(tmp[pre : i + 1]))
                pre = i + 1
            if i == n - 1:
                nums.append(int(tmp[pre:]))
        ans += sum(nums)
    print(ans)

-S = eval(input()) -N = len(S) - 1 +import sys - -def culc(string): -    string = list(string) -    digit = [] -    prev = 0 -    for i, s in enumerate(string): -        if s == "+": -            digit.append(int("".join(string[prev:i]))) -            prev = i + 1 -        if i == len(string) - 1: -            digit.append(int("".join(string[prev:]))) -    return sum(digit) - - -SUM = 0 -for bit in range(0, 1 << N): -    string = S -    for i in reversed(list(range(N))): -        if (bit >> i) & 1: -            string = string[: i + 1] + "+" + string[i + 1 :] -    SUM += culc(string) -print(SUM) +input = sys.stdin.readline +sys.setrecursionlimit(10**7) +S = input()[:-1]  # 改行をなくす +n = len(S) - 1  # +を入れる事ができる場所の数 +# bit全探索 +P = [] +for bit in range(0, 1 << n):  # 00 ~ 11 +    plus = [""] * n +    for j in range(n): +        if bit >> j & 1: +            plus[j] = "+" +    P.append(plus) +ans = 0 +if n == 0: +    print((int(S))) +else: +    for plus in P: +        nums = [] +        tmp = S +        pre = 0 +        for i in range(n): +            if plus[i] == "+": +                nums.append(int(tmp[pre : i + 1])) +                pre = i + 1 +            if i == n - 1: +                nums.append(int(tmp[pre:])) +        ans += sum(nums) +    print(ans)