output_description: Print the computational result in a line.
input_description: An expression is given in a line. Two consequtive symbols (operand or
  operator) are separated by a space character.
  
  You can assume that +, - and * are given as the operator and an operand is a
  positive integer less than 106
attempt: #!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  """
  Created on Mon May  8 15:36:48 2017
  
  @author: Tomohisa
  """
  
  import sys
  
  
  def push(a, stack):
      stack = stack + [a]
      # print(stack)
      return stack
  
  
  def pop(stack):
      a = stack[-1]
      stack = stack[:-1]
      # print(stack)
      return a, stack
  
  
  fname = sys.argv[1]
  
  f = open(fname)
  
  l = f.read().split()
  
  stack = []
  
  for i in range(len(l)):
      if l[i] == "+":
          b, stack = pop(stack)
          a, stack = pop(stack)
          stack = push(int(a) + int(b), stack)
      elif l[i] == "-":
          b, stack = pop(stack)
          a, stack = pop(stack)
          stack = push(int(a) - int(b), stack)
      elif l[i] == "*":
          b, stack = pop(stack)
          a, stack = pop(stack)
          stack = push(int(a) * int(b), stack)
      else:
          stack = push(l[i], stack)
  
  print(pop(stack)[0])
  
problem_description: Input
  
  An expression is given in a line. Two consequtive symbols (operand or
  operator) are separated by a space character.
  
  You can assume that +, - and * are given as the operator and an operand is a
  positive integer less than 106
samples: [{"input": "1 2 +", "output": "3"}, {"input": "1 2 + 3 4 - *", "output": "-3"}]