import scala.io.Source.stdin

object Main extends App {
  def calc(op:String,x:Double,y:Double):Double = {
    op match {
      case "+" => x+y
      case "-" => x-y
      case "/" => x/y
      case "*" => x*y
      case _ => throw new Exception("Unexpected")
    }
  }

  def revP(a:Array[String],i:Int,l:List[Double]):Double = {
    if(i==a.length) l.head
    else if(a(i) != "-" && a(i).forall(x=>x=='-' || x.isDigit)) revP(a,i+1,a(i).toDouble::l)
    else {
      l match {
        case hd1::hd2::tl => revP(a,i+1, calc(a(i),hd2,hd1)::tl)
        case _ => throw new Exception("Unexpected")
      }
    }
  }
  stdin.getLines.foreach { s=>
    printf("%.6f\n",revP(s.split(" "),0,Nil))
  }
}