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

    object P extends Application{
    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))}