import sys



def debug(x, table):

    for name, val in table.items():

        if x is val:

            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)

            return None



def solve():

    S = input()

    N = len(S) - 1

    ans = 0



    for i in range(2**N):

        bi = bin(i)[2:].zfill(N)

        # print(bi)

        ans += calc(S, bi)



    print(ans)



def calc(S, bi):

    ret = 0

    k = 0



    for i in range(len(S)):

        if i == 0:

            continue

        else:

            if bi[i-1] == '1':

                ret += int(S[k:i])

                k = i



    ret += int(S[k:])



    return ret



if __name__ == '__main__':

    solve()

import sys

from itertools import accumulate



def debug(x, table):

    for name, val in table.items():

        if x is val:

            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)

            return None



def solve():

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

    N = len(S)

    sac = [0] + list(accumulate(S))

    ans = 0



    for i in range(N):

        ans += (int(sac[i] * 2**(i - 1)) + 2**i * S[i]) * 10**(N - 1 - i)



    print(ans)



if __name__ == '__main__':

    solve()

import sys


def debug(x, table):
    for name, val in table.items():
        if x is val:
            print("DEBUG:{} -> {}".format(name, val), file=sys.stderr)
            return None


def solve():
    S = input()
    N = len(S) - 1
    ans = 0
    for i in range(2**N):
        bi = bin(i)[2:].zfill(N)
        # print(bi)
        ans += calc(S, bi)
    print(ans)


def calc(S, bi):
    ret = 0
    k = 0
    for i in range(len(S)):
        if i == 0:
            continue
        else:
            if bi[i - 1] == "1":
                ret += int(S[k:i])
                k = i
    ret += int(S[k:])
    return ret


if __name__ == "__main__":
    solve()

import sys
from itertools import accumulate


def debug(x, table):
    for name, val in table.items():
        if x is val:
            print("DEBUG:{} -> {}".format(name, val), file=sys.stderr)
            return None


def solve():
    S = [int(i) for i in input()]
    N = len(S)
    sac = [0] + list(accumulate(S))
    ans = 0
    for i in range(N):
        ans += (int(sac[i] * 2 ** (i - 1)) + 2**i * S[i]) * 10 ** (N - 1 - i)
    print(ans)


if __name__ == "__main__":
    solve()

+from itertools import accumulate -    S = input() -    N = len(S) - 1 +    S = [int(i) for i in input()] +    N = len(S) +    sac = [0] + list(accumulate(S)) -    for i in range(2**N): -        bi = bin(i)[2:].zfill(N) -        # print(bi) -        ans += calc(S, bi) +    for i in range(N): +        ans += (int(sac[i] * 2 ** (i - 1)) + 2**i * S[i]) * 10 ** (N - 1 - i) - - -def calc(S, bi): -    ret = 0 -    k = 0 -    for i in range(len(S)): -        if i == 0: -            continue -        else: -            if bi[i - 1] == "1": -                ret += int(S[k:i]) -                k = i -    ret += int(S[k:]) -    return ret