S = eval(input())

if len(S) == 1:

  print((int(S)))

  exit()

else:

  def count(n):

    if len(n) == 1:

      return 0

    else:

      a = 0

      for i in range(1, len(n)):

        a += int(n[:i]) * 2 ** (len(n) - 1 - i) + int(n[i:]) + count(n[i:])

      return a

  ans = int(S) + count(S)

  print(ans)
   

s=eval(input())



if len(s)==1:

    print((int(s)))

else:

    def count(num):

        # basecase

        if len(num)==1:

            return 0

        else:

            a=0

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

                a+=int(num[:j])*2**(len(num[j:])-1)+int(num[j:])+count(num[j:])

            return a

    ans=int(s)+count(s)

    print(ans)

S = eval(input())
if len(S) == 1:
    print((int(S)))
    exit()
else:

    def count(n):
        if len(n) == 1:
            return 0
        else:
            a = 0
            for i in range(1, len(n)):
                a += int(n[:i]) * 2 ** (len(n) - 1 - i) + int(n[i:]) + count(n[i:])
            return a

    ans = int(S) + count(S)
    print(ans)

s = eval(input())
if len(s) == 1:
    print((int(s)))
else:

    def count(num):
        # basecase
        if len(num) == 1:
            return 0
        else:
            a = 0
            for j in range(1, len(num)):
                a += (
                    int(num[:j]) * 2 ** (len(num[j:]) - 1)
                    + int(num[j:])
                    + count(num[j:])
                )
            return a

    ans = int(s) + count(s)
    print(ans)

-S = eval(input()) -if len(S) == 1: -    print((int(S))) -    exit() +s = eval(input()) +if len(s) == 1: +    print((int(s))) -    def count(n): -        if len(n) == 1: +    def count(num): +        # basecase +        if len(num) == 1: -            for i in range(1, len(n)): -                a += int(n[:i]) * 2 ** (len(n) - 1 - i) + int(n[i:]) + count(n[i:]) +            for j in range(1, len(num)): +                a += ( +                    int(num[:j]) * 2 ** (len(num[j:]) - 1) +                    + int(num[j:]) +                    + count(num[j:]) +                ) -    ans = int(S) + count(S) +    ans = int(s) + count(s)