#include <iostream>
#include <cstdio>
#include <stack>
using namespace std;
 
double eval(double a, double b, char oper){
    if( oper == '+' ) return a + b;
    if( oper == '-' ) return a - b;
    if( oper == '*' ) return a * b;
    if( oper == '/' ) return a / b;
    return 0.0;
}
 
int main(){
    string expr;
    while( getline(cin, expr) ){
        stack<double> stk;
        string::iterator it = expr.begin();
        while( true ){
            if( ( *it == '-' && it+1 != expr.end() && isdigit( *(it+1) ) ) ||
                isdigit( *it ) ){
                string::iterator tmp = it;
                if( *it == '-' ) it++;
                double a = 0;
                while( it != expr.end() && *it != '\n' && *it != ' ' ){
                    a *= 10;
                    a += *it - '0';
                    it++;
                }
                if( *tmp == '-' ) a *= -1;
                stk.push( a );
            }else{
                double b, c;
                b = stk.top();
                stk.pop();
                c = stk.top();
                stk.pop();
                stk.push( eval(c, b, *it) );
                it++;
            }
            if( it == expr.end() ) break;
            it++;
        }
        printf("%.6lf\n", stk.top());
        stk.pop();
    }
    return 0;
}