#n = int(input())

#n,k = map(int,input().split())

#x = list(map(int,input().split()))





s = list(eval(input()))



ans = 0



for i in range(1<<len(s)):

    ttl = []

    memo = s[0]

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

        if (i>>j)&1:

            memo += s[j]

        else:

            ttl.append(int(memo))

            memo = s[j]

    ttl.append(int(memo))

    

    ans += sum(ttl)

    ttl = []



print((ans//2))





#n = int(input())

#n,k = map(int,input().split())

#x = list(map(int,input().split()))





s = list(eval(input()))



ans = 0



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

    ttl = []

    memo = s[0]

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

        if (i>>j)&1:

            memo += s[j+1]

        else:

            ttl.append(int(memo))

            memo = s[j+1]

    ttl.append(int(memo))

    ans += sum(ttl)

    ttl = []



print(ans)





# n = int(input())
# n,k = map(int,input().split())
# x = list(map(int,input().split()))
s = list(eval(input()))
ans = 0
for i in range(1 << len(s)):
    ttl = []
    memo = s[0]
    for j in range(1, len(s)):
        if (i >> j) & 1:
            memo += s[j]
        else:
            ttl.append(int(memo))
            memo = s[j]
    ttl.append(int(memo))
    ans += sum(ttl)
    ttl = []
print((ans // 2))

# n = int(input())
# n,k = map(int,input().split())
# x = list(map(int,input().split()))
s = list(eval(input()))
ans = 0
for i in range(1 << len(s) - 1):
    ttl = []
    memo = s[0]
    for j in range(0, len(s) - 1):
        if (i >> j) & 1:
            memo += s[j + 1]
        else:
            ttl.append(int(memo))
            memo = s[j + 1]
    ttl.append(int(memo))
    ans += sum(ttl)
    ttl = []
print(ans)

-for i in range(1 << len(s)): +for i in range(1 << len(s) - 1): -    for j in range(1, len(s)): +    for j in range(0, len(s) - 1): -            memo += s[j] +            memo += s[j + 1] -            memo = s[j] +            memo = s[j + 1] -print((ans // 2)) +print(ans)