output_description: Print the sum of the evaluated value over all possible formulas.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      S
attempt: # -*- coding: utf-8 -*-
  import bisect
  import heapq
  import math
  import random
  import sys
  from collections import Counter, defaultdict, deque
  from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
  from functools import lru_cache, reduce
  from itertools import combinations, combinations_with_replacement, product, permutations
  from operator import add, mul, sub
  
  sys.setrecursionlimit(100000)
  input = sys.stdin.readline
  INF = 2**62 - 1
  
  
  def read_int():
      return int(input())
  
  
  def read_int_n():
      return list(map(int, input().split()))
  
  
  def read_float():
      return float(input())
  
  
  def read_float_n():
      return list(map(float, input().split()))
  
  
  def read_str():
      return input().strip()
  
  
  def read_str_n():
      return list(map(str, input().split()))
  
  
  def error_print(*args):
      print(*args, file=sys.stderr)
  
  
  def mt(f):
      import time
  
      def wrap(*args, **kwargs):
          s = time.time()
          ret = f(*args, **kwargs)
          e = time.time()
  
          error_print(e - s, "sec")
          return ret
  
      return wrap
  
  
  @mt
  def slv(S):
      ans = 0
      N = len(S)
      for i in range(N):
          for j in range(i + 1, N + 1):
              l = 2 ** (max(0, i - 1))
              r = 2 ** (max(0, N - j - 1))
              ans += int(S[i:j]) * l * r
      return ans
  
  
  def main():
      S = read_str()
      print(slv(S))
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  You are given a string S consisting of digits between `1` and `9`, inclusive.
  You can insert the letter `+` into some of the positions (possibly none)
  between two letters in this string. Here, `+` must not occur consecutively
  after insertion.
  
  All strings that can be obtained in this way can be evaluated as formulas.
  
  Evaluate all possible formulas, and print the sum of the results.
samples: [{"input": "125", "output": "176\n    \n\nThere are 4 formulas that can be obtained: `125`, `1+25`, `12+5` and `1+2+5`.\nWhen each formula is evaluated,\n\n  * 125\n  * 1+25=26\n  * 12+5=17\n  * 1+2+5=8\n\nThus, the sum is 125+26+17+8=176.\n\n* * *"}, {"input": "9999999999", "output": "12656242944"}]