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: import copy
  
  s = input()
  n = len(s)
  ints = int(s)
  
  # くっつけるか、数値としてたすパターンを再帰関数で回せばいい
  
  all_sum = [0]
  num = []
  # 各桁のそれぞれの数字を出力するアルゴリズム
  while ints != 0:
      # print(num)
      num.append(str(ints % 10))
      ints //= 10
  num.reverse()
  
  
  def DFS(num, count, sum):
      if count == n:
          # print(num)
          # print(sum)
          all_sum[0] += sum
          return
  
      num_coppy = copy.deepcopy(num)
      # そのまま足しちゃう
  
      sum += int(num_coppy[count])
      # print(int(num_coppy[count]))
      count += 1
      DFS(num_coppy, count, sum)
  
      count -= 1
  
      # 　一個後とくっつける
      if count <= n - 2:
  
          num_coppy[count + 1] = num_coppy[count] + num_coppy[count + 1]
          sum -= int(num_coppy[count])
          count += 1
          DFS(num_coppy, count, sum)
  
      return
  
  
  DFS(num, 0, 0)
  
  
  print(all_sum[0])
  
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"}]