while 1:
   line = raw_input()
   if not line:
      break
   stack = []
   tokens = line.rstrip().split(' ')
   for token in tokens:
      try:
         value = float(token)
         stack.append(token)
      except ValueError:
         second = stack.pop()
         first = stack.pop()
         try:
            stack.append(str(eval(first + token + second)))
         except SyntaxError:
            raise ValueError, "Bad operator: " + token
   print stack[-1] 

