import Text.Printf
main = do
  s <- getContents
  let l = map words . lines $ s
  mapM_ (putStrLn . printf "%.6f" . invpol [] ) l

invpol::[Double] -> [String] -> Double
invpol [x] [] = x
invpol y (x:xs)
  | x == "+" = invpol (((head.tail $ y) + (head y) ):(tail.tail $ y)) xs
  | x == "-" = invpol (((head.tail $ y) - (head y) ):(tail.tail $ y)) xs
  | x == "*" = invpol (((head.tail $ y) * (head y) ):(tail.tail $ y)) xs
  | x == "/" = invpol (((head.tail $ y) / (head y) ):(tail.tail $ y)) xs
  | otherwise = invpol (((read::String->Double) x):y) xs