# bit全探索の解法

s = eval(input())

# "+"は数字の間にしか入らないので、n-1で調べる

n = len(s) -1



ans = 0

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

    f = s[0]

    for i in range(n):

        if (bit >> i) & 1 :

            f += "+"

        f += s[i + 1]

    #print(f)

    ans += eval(f)



print(ans)

def dfs(i, f):

    if i == n-1:

        return sum(list(map(int, f.split("+"))))

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



s = eval(input())

n = len(s)

print((dfs(0, s[0])))
# bit全探索の解法
s = eval(input())
# "+"は数字の間にしか入らないので、n-1で調べる
n = len(s) - 1
ans = 0
for bit in range(1 << (n)):
    f = s[0]
    for i in range(n):
        if (bit >> i) & 1:
            f += "+"
        f += s[i + 1]
    # print(f)
    ans += eval(f)
print(ans)

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


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

-# bit全探索の解法 +def dfs(i, f): +    if i == n - 1: +        return sum(list(map(int, f.split("+")))) +    return dfs(i + 1, f + s[i + 1]) + dfs(i + 1, f + "+" + s[i + 1]) + + -# "+"は数字の間にしか入らないので、n-1で調べる -n = len(s) - 1 -ans = 0 -for bit in range(1 << (n)): -    f = s[0] -    for i in range(n): -        if (bit >> i) & 1: -            f += "+" -        f += s[i + 1] -    # print(f) -    ans += eval(f) -print(ans) +n = len(s) +print((dfs(0, s[0])))