s = eval(input())

ans = 0

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

    f = s[0]

    for j in range(len(s) - 1):

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

            f += "+"

        f += s[j + 1]

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

print(ans)
def dfs(i, s, plus):

    if i == n - 1:

        b = list(map(int, s.split("+")))

        return sum(b)

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



s = eval(input())

n = len(s)



print((dfs(0, s, 0)))
s = eval(input())
ans = 0
for i in range(2 ** (len(s) - 1)):
    f = s[0]
    for j in range(len(s) - 1):
        if ((i >> j) & 1) == 1:
            f += "+"
        f += s[j + 1]
    ans += sum(map(int, f.split("+")))
print(ans)

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


s = eval(input())
n = len(s)
print((dfs(0, s, 0)))

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