#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        string s;
        getline(cin, s);
        if(s.size() == 0)
            return 0;

        istringstream iss(s);
        stack<double> stk;
        for(;;){
            if(iss >> s){
                if('0' <= s[0] && s[0] <= '9')
                    stk.push(atoi(s.c_str()));
                else{
                    double x = stk.top();
                    stk.pop();
                    double y = stk.top();
                    stk.pop();
                    if(s == "+")
                        stk.push(y + x);
                    else if(s == "-")
                        stk.push(y - x);
                    else if(s == "*")
                        stk.push(y * x);
                    else
                        stk.push(y / x);
                }
            }else
                break;
        }
        printf("%.10f\n", stk.top());
    }
}