S = eval(input())

if len(S) == 1:

  print((int(S)))

else:

  def count(n):

    a = 0

    if len(n) == 1:

      return 0

    else:

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

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

      return a

  print((int(S) + count(S)))
S = eval(input())

if len(S) == 1:

  print((int(S)))

  exit()

else:

  def count(n):

    a = 0

    if len(n) == 1:

      return 0

    else:

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

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

      return a

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

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

    print((int(S) + count(S)))

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

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

    print((int(S) + count(S)))

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