import scala.collection.mutable
import scala.util.control.Breaks
object Main extends App {
  val b = Breaks

  b.breakable {
    for (line <- io.Source.stdin.getLines()) {
      if (line.isEmpty) b.break()

      val stk = new mutable.Stack[Double]()

      for (sym <- line.split(' ')) {
        sym match {
          case "+" => {
            val x = stk.pop()
            val y = stk.pop()
            stk.push(y + x)
          }
          case "-" => {
            val x = stk.pop()
            val y = stk.pop()
            stk.push(y - x)
          }
          case "*" => {
            val x = stk.pop()
            val y = stk.pop()
            stk.push(y * x)
          }
          case "/" => {
            val x = stk.pop()
            val y = stk.pop()
            stk.push(y / x)
          }
          case _ => {
            stk.push(sym.toInt)
          }
        }
      }
      println(stk.pop())
    }
  }
}
