###Scala <strike>412</strike> 376:

    object P extends Application{
    def p(t:List[String],u:List[Double]):Double=t match{
    case Nil=>u.head
    case x::y=>x match{
    case "+"=>p(y,(u(1)+u(0))::u.tail.tail)
    case "-"=>p(y,(u(1)-u(0))::u.tail.tail)
    case "*"=>p(y,(u(1)*u(0))::u.tail.tail)
    case "/"=>p(y,(u(1)/u(0))::u.tail.tail)
    case (d)=>p(y,d.toDouble::u)}}
    println (p((readLine().split(" ")).toList,List():List[Double]))}