isOperator str = str=="+" || str=="-" || str=="*" || str=="/"

operatorCalc :: Float -> Float -> String -> Float
operatorCalc a b op | op=="+"   = a+b
                    | op=="-"   = a-b
                    | op=="*"   = a*b
                    | op=="/"   = a/b
                    | otherwise = 0.0


reversePolishNotation::[String]->[String]
reversePolishNotation (a:[])       = [a]
reversePolishNotation (a:b:[])     = [a,b]
reversePolishNotation (a:b:c:expr) = if ( isOperator c && not (isOperator b) && not (isOperator a))
                                        then reversePolishNotation( [show(operatorCalc (read a ::Float) (read b ::Float) c)] ++ expr)
                                        else if isOperator b
                                            then a:b:c:expr
                                            else reversePolishNotation( a:reversePolishNotation (b:c:expr))

main = do{
    getLine>>=putStrLn.head.reversePolishNotation.words;
}