

def main():

    s = eval(input())

    num = 2**(len(s)-1)

    bit_len = len(bin(num))



    def func(ｎ):

        n = bin(n)

        n_len = len(n)

        n = "0"*( bit_len - n_len - 1 ) + n[-len(n)+2:]

        indexes = [i+1 for i, x in enumerate(ｎ) if x == "1"]

        ans = 0

        temp = 0

        for i in indexes:

            ans += int(s[temp:i])

            temp = i

        else:

            if temp != bit_len-2:

                ans += int(s[temp:])



        return ans



    ans = 0

    for i in range(num):

        ans += func(i)

    print(ans)



main()

S = [int(i) for i in eval(input())]



N = len(S)

ans = 0

for i in range(N):

    left = i

    right = N - i - 1

    score = 1

    for k in range(0, right + 1):

        if right - k > 0:

            ans += S[i] * score * (1 << left) * (1 << (right - k - 1))

        else:

            ans += S[i] * score * (1 << left)

        score *= 10



print(ans)
def main():
    s = eval(input())
    num = 2 ** (len(s) - 1)
    bit_len = len(bin(num))

    def func(ｎ):
        n = bin(n)
        n_len = len(n)
        n = "0" * (bit_len - n_len - 1) + n[-len(n) + 2 :]
        indexes = [i + 1 for i, x in enumerate(ｎ) if x == "1"]
        ans = 0
        temp = 0
        for i in indexes:
            ans += int(s[temp:i])
            temp = i
        else:
            if temp != bit_len - 2:
                ans += int(s[temp:])
        return ans

    ans = 0
    for i in range(num):
        ans += func(i)
    print(ans)


main()

S = [int(i) for i in eval(input())]
N = len(S)
ans = 0
for i in range(N):
    left = i
    right = N - i - 1
    score = 1
    for k in range(0, right + 1):
        if right - k > 0:
            ans += S[i] * score * (1 << left) * (1 << (right - k - 1))
        else:
            ans += S[i] * score * (1 << left)
        score *= 10
print(ans)

-def main(): -    s = eval(input()) -    num = 2 ** (len(s) - 1) -    bit_len = len(bin(num)) - -    def func(ｎ): -        n = bin(n) -        n_len = len(n) -        n = "0" * (bit_len - n_len - 1) + n[-len(n) + 2 :] -        indexes = [i + 1 for i, x in enumerate(ｎ) if x == "1"] -        ans = 0 -        temp = 0 -        for i in indexes: -            ans += int(s[temp:i]) -            temp = i +S = [int(i) for i in eval(input())] +N = len(S) +ans = 0 +for i in range(N): +    left = i +    right = N - i - 1 +    score = 1 +    for k in range(0, right + 1): +        if right - k > 0: +            ans += S[i] * score * (1 << left) * (1 << (right - k - 1)) -            if temp != bit_len - 2: -                ans += int(s[temp:]) -        return ans - -    ans = 0 -    for i in range(num): -        ans += func(i) -    print(ans) - - -main() +            ans += S[i] * score * (1 << left) +        score *= 10 +print(ans)