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())

cnt=0

result = 0

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

  mark_list = S[0]

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

    if (i>>j)&1 == 1:

      mark_list+="+"+S[j+1] 

    else:

      mark_list+=S[j+1]

  result+=eval(mark_list)

print(result)
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())
cnt = 0
result = 0
for i in range(2 ** (len(S) - 1)):
    mark_list = S[0]
    for j in range(len(S) - 1):
        if (i >> j) & 1 == 1:
            mark_list += "+" + S[j + 1]
        else:
            mark_list += S[j + 1]
    result += eval(mark_list)
print(result)

-if len(S) == 1: -    print((int(S))) -    exit() -else: - -    def count(n): -        a = 0 -        if len(n) == 1: -            return 0 +cnt = 0 +result = 0 +for i in range(2 ** (len(S) - 1)): +    mark_list = S[0] +    for j in range(len(S) - 1): +        if (i >> j) & 1 == 1: +            mark_list += "+" + S[j + 1] -            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))) +            mark_list += S[j + 1] +    result += eval(mark_list) +print(result)