###Scala <strike>412 376 349 335</strike> 312:

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