#include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
using namespace std;

int main() {

    string line;

    while(getline(cin, line)) {
        stack<double> stk;
        while(line != "") {

            double a, b;

            string sp;
            if (line.find(" ") != -1) {
                sp = line.substr(0, line.find(" "));
                line = line.substr(line.find(" ") + 1);
            } else {
                sp = line;
                line = "";
            }

            if (sp == "+") {
                a = stk.top();
                stk.pop();
                b = stk.top();
                stk.pop();
                stk.push(a + b);
            } else if (sp == "-") {
                a = stk.top();
                stk.pop();
                b = stk.top();
                stk.pop();
                stk.push(b - a);
            } else if (sp == "*") {
                a = stk.top();
                stk.pop();
                b = stk.top();
                stk.pop();
                stk.push(a * b);
            } else if (sp == "/") {
                a = stk.top();
                stk.pop();
                b = stk.top();
                stk.pop();
                stk.push(b / a);
            } else {
                stk.push((double)atoi(sp.c_str()));
            }
        }

        printf("%.6f", stk.top());
        cout << endl;

    }

     
    return 0;
}