#include<iostream>
#include<cstdio>
#include<cctype>
#include<cstdlib>
#include<string>
#include<sstream>
#include<vector>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)

double cal(vector<double> &v, string op){
    double right = v[v.size() - 1];
    double left = v[v.size() - 2];
    v.pop_back();
    v.pop_back();
    if(op == "+") return left + right;
    if(op == "-") return left - right;
    if(op == "*") return left * right;
    if(op == "/") return left / right;
}

int main(){
    string str;
    while(getline(cin, str)){
        stringstream ss(str);
        vector<double> v;
        while(ss >>str){
            if(str.length() != 1 && str[0] == '-') v.push_back( -1.0 * atoi(str.substr(1).c_str()) );
            else if(isdigit(str[0])) v.push_back( (double)(atoi(str.c_str())) );
            else v.push_back( cal(v, str) );
        }
        printf("%.7lf\n", v[0]);
    }
    return 0;
}