a=list(eval(input()))

ans=0

for i in range(1<<(len(a)-1)):

    s=a[0]

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

        if i & (1<<j):

            s+="+"

        s+=a[j+1]

    ans+=eval(s)

print(ans)    
N=int(eval(input()))

m=list(map(int,str(N)))[::-1]

p=0

n=len(str(N))

if n==1:

    print(N)

    exit()

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

    s=(["0"]*8+list(bin(i)[2:]))[::-1]

    s=s[:n-1]

    p+=m[0]

    q=0

    for i in range(n-1):

        if s[i]=="0":

            q+=1

            p+=(10**q)*(m[i+1])

        else:

            q=0

            p+=m[i+1]

print(p)            

        

        
a = list(eval(input()))
ans = 0
for i in range(1 << (len(a) - 1)):
    s = a[0]
    for j in range(len(a) - 1):
        if i & (1 << j):
            s += "+"
        s += a[j + 1]
    ans += eval(s)
print(ans)

N = int(eval(input()))
m = list(map(int, str(N)))[::-1]
p = 0
n = len(str(N))
if n == 1:
    print(N)
    exit()
for i in range(2 ** (n - 1)):
    s = (["0"] * 8 + list(bin(i)[2:]))[::-1]
    s = s[: n - 1]
    p += m[0]
    q = 0
    for i in range(n - 1):
        if s[i] == "0":
            q += 1
            p += (10**q) * (m[i + 1])
        else:
            q = 0
            p += m[i + 1]
print(p)

-a = list(eval(input())) -ans = 0 -for i in range(1 << (len(a) - 1)): -    s = a[0] -    for j in range(len(a) - 1): -        if i & (1 << j): -            s += "+" -        s += a[j + 1] -    ans += eval(s) -print(ans) +N = int(eval(input())) +m = list(map(int, str(N)))[::-1] +p = 0 +n = len(str(N)) +if n == 1: +    print(N) +    exit() +for i in range(2 ** (n - 1)): +    s = (["0"] * 8 + list(bin(i)[2:]))[::-1] +    s = s[: n - 1] +    p += m[0] +    q = 0 +    for i in range(n - 1): +        if s[i] == "0": +            q += 1 +            p += (10**q) * (m[i + 1]) +        else: +            q = 0 +            p += m[i + 1] +print(p)