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 itertools
  
  def solve(S):
      '''
      数字の間に+を入れるパターンと入れないパターンを全てチェックする
      125であれば、 125, 1+25, 12+5, 1+2+5
      +が入る可能性のある場所は右の通り、 1  |ここ!| 2  |ここ!| 5
      よって、組み合わせは 2 ** (文字列数 - 1)
      '''
      count = 0
      bit_list = list(itertools.product([0, 1], repeat=len(S)-1))
      for pattern in bit_list:
              '''
              ビットの値が1の時に+が入ると考えて、0の時は入らない
              文字列を先頭から調べていき、次の文字との間に+が入る場合、そこまでの文字列をint型に変換して変数「count」に加算する
              
              '''
          start = 0
          for end in range(len(pattern)):
              if pattern[end] == 1:
                  count += int(S[start:end+1])
                  start = end + 1
                  
              if end == len(bit) - 1:
                  count += int(S[start:])
                  
      print(count)
  
  
  if __name__ == '__main__':
      S = input()
      solve(S)
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"}]