S = eval(input())

n = len(S)

ans = 0

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

    p = [''] * (n - 1)

    for j in range(n - 1):

        if i >> j & 1:

            p[j] = '+'

    s = [None] * (2 * n - 1)

    s[::2] = list(S)

    s[1::2] = p

    s = ''.join(s)

    ans += eval(s)

print(ans)
def main():

    S = eval(input())

    ans = 0

    for i in range(1 << (n := len(S) - 1)):

        T = ''

        for j in range(n):

            if i >> j & 1:

                T += S[j] + '+'

            else:

                T += S[j]

        T += S[n]

        ans += eval(T)

    print(ans)



if __name__ == '__main__':

    main()

S = eval(input())
n = len(S)
ans = 0
for i in range(2 ** (n - 1)):
    p = [""] * (n - 1)
    for j in range(n - 1):
        if i >> j & 1:
            p[j] = "+"
    s = [None] * (2 * n - 1)
    s[::2] = list(S)
    s[1::2] = p
    s = "".join(s)
    ans += eval(s)
print(ans)

def main():
    S = eval(input())
    ans = 0
    for i in range(1 << (n := len(S) - 1)):
        T = ""
        for j in range(n):
            if i >> j & 1:
                T += S[j] + "+"
            else:
                T += S[j]
        T += S[n]
        ans += eval(T)
    print(ans)


if __name__ == "__main__":
    main()

-S = eval(input()) -n = len(S) -ans = 0 -for i in range(2 ** (n - 1)): -    p = [""] * (n - 1) -    for j in range(n - 1): -        if i >> j & 1: -            p[j] = "+" -    s = [None] * (2 * n - 1) -    s[::2] = list(S) -    s[1::2] = p -    s = "".join(s) -    ans += eval(s) -print(ans) +def main(): +    S = eval(input()) +    ans = 0 +    for i in range(1 << (n := len(S) - 1)): +        T = "" +        for j in range(n): +            if i >> j & 1: +                T += S[j] + "+" +            else: +                T += S[j] +        T += S[n] +        ans += eval(T) +    print(ans) + + +if __name__ == "__main__": +    main()