if __name__ == '__main__':

    S = list(eval(input()))



    answer = 0

    for i in range(2**(len(S)-1)):



        operators = (list(format(i, '0' + str(len(S)-1) + 'b').replace('1', '+').replace('0', ' ')))



        state = S[0]

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

            state += operators[j] + S[j+1]

        state = state.replace(' ', '')



        answer += eval(state)



    print(answer)
if __name__ == '__main__':

    S = list(eval(input()))

    ans = 0

    for state in range(1 << (len(S)-1)):

        ans += eval(S[0] + ''.join(('+' if (state >> i & 1) else '')+x for i, x in enumerate(S[1:])))

        # print(str(state))

        # print(S[0] + ''.join(('+' if (state >> i & 1) else '')+x for i, x in enumerate(S[1:])))

        # print("------------------")

    print(ans)
if __name__ == "__main__":
    S = list(eval(input()))
    answer = 0
    for i in range(2 ** (len(S) - 1)):
        operators = list(
            format(i, "0" + str(len(S) - 1) + "b").replace("1", "+").replace("0", " ")
        )
        state = S[0]
        for j in range(len(S) - 1):
            state += operators[j] + S[j + 1]
        state = state.replace(" ", "")
        answer += eval(state)
    print(answer)

if __name__ == "__main__":
    S = list(eval(input()))
    ans = 0
    for state in range(1 << (len(S) - 1)):
        ans += eval(
            S[0]
            + "".join(
                ("+" if (state >> i & 1) else "") + x for i, x in enumerate(S[1:])
            )
        )
        # print(str(state))
        # print(S[0] + ''.join(('+' if (state >> i & 1) else '')+x for i, x in enumerate(S[1:])))
        # print("------------------")
    print(ans)

-    answer = 0 -    for i in range(2 ** (len(S) - 1)): -        operators = list( -            format(i, "0" + str(len(S) - 1) + "b").replace("1", "+").replace("0", " ") +    ans = 0 +    for state in range(1 << (len(S) - 1)): +        ans += eval( +            S[0] +            + "".join( +                ("+" if (state >> i & 1) else "") + x for i, x in enumerate(S[1:]) +            ) -        state = S[0] -        for j in range(len(S) - 1): -            state += operators[j] + S[j + 1] -        state = state.replace(" ", "") -        answer += eval(state) -    print(answer) +        # print(str(state)) +        # print(S[0] + ''.join(('+' if (state >> i & 1) else '')+x for i, x in enumerate(S[1:]))) +    print(ans)