s = eval(input())

n = len(s) - 1

answers = []

sl = [s[i] for i in range(len(s))]

for i in range(2 ** n):

    tmp = []

    for j in range(n):

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

            tmp.append(j)

    ll = ['*']*len(s)

    for k in tmp:

        ll[k] = '+'

    ans = []

    for k, _ in zip(sl, ll):

        ans.append(k)

        ans.append(_)

    ans = [_ for _ in ans if _ != '*']

    ans = ''.join(ans)

    ans = ans.split('+')

    ans = [int(_) for _ in ans if _ != '+']

    ans = sum(ans)

    answers.append(ans)

print((sum(answers)))
s = eval(input())

n = len(s)



ans = 0



for bit in range(1 << (n - 1)):

    f = s[0]



    for i in range(n - 1):

        # ここのif文の判定基準が理解できていません。

        if bit & (1 << i):

            f += "+"

        f += s[i + 1]



    ans += sum(map(int, f.split("+")))



print(ans)
s = eval(input())
n = len(s) - 1
answers = []
sl = [s[i] for i in range(len(s))]
for i in range(2**n):
    tmp = []
    for j in range(n):
        if (i >> j) & 1:
            tmp.append(j)
    ll = ["*"] * len(s)
    for k in tmp:
        ll[k] = "+"
    ans = []
    for k, _ in zip(sl, ll):
        ans.append(k)
        ans.append(_)
    ans = [_ for _ in ans if _ != "*"]
    ans = "".join(ans)
    ans = ans.split("+")
    ans = [int(_) for _ in ans if _ != "+"]
    ans = sum(ans)
    answers.append(ans)
print((sum(answers)))

s = eval(input())
n = len(s)
ans = 0
for bit in range(1 << (n - 1)):
    f = s[0]
    for i in range(n - 1):
        # ここのif文の判定基準が理解できていません。
        if bit & (1 << i):
            f += "+"
        f += s[i + 1]
    ans += sum(map(int, f.split("+")))
print(ans)

-n = len(s) - 1 -answers = [] -sl = [s[i] for i in range(len(s))] -for i in range(2**n): -    tmp = [] -    for j in range(n): -        if (i >> j) & 1: -            tmp.append(j) -    ll = ["*"] * len(s) -    for k in tmp: -        ll[k] = "+" -    ans = [] -    for k, _ in zip(sl, ll): -        ans.append(k) -        ans.append(_) -    ans = [_ for _ in ans if _ != "*"] -    ans = "".join(ans) -    ans = ans.split("+") -    ans = [int(_) for _ in ans if _ != "+"] -    ans = sum(ans) -    answers.append(ans) -print((sum(answers))) +n = len(s) +ans = 0 +for bit in range(1 << (n - 1)): +    f = s[0] +    for i in range(n - 1): +        # ここのif文の判定基準が理解できていません。 +        if bit & (1 << i): +            f += "+" +        f += s[i + 1] +    ans += sum(map(int, f.split("+"))) +print(ans)