#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <stack>
using namespace std;

double dbl(string s) {
    stringstream ss(s);
    double ret;
    ss >> ret;
    return ret;
}

int main() {
    string line;
    while (getline(cin, line)) {
        stringstream ss(line);
        stack<double> stk;
        string s;
        while (ss >> s) {
            if (s == "+") {
                double b = stk.top(); stk.pop();
                double a = stk.top(); stk.pop();
                stk.push(a + b);
            } else if (s == "-") {
                double b = stk.top(); stk.pop();
                double a = stk.top(); stk.pop();
                stk.push(a - b);
            } else if (s == "*") {
                double b = stk.top(); stk.pop();
                double a = stk.top(); stk.pop();
                stk.push(a * b);
            } else if (s == "/") {
                double b = stk.top(); stk.pop();
                double a = stk.top(); stk.pop();
                stk.push(a / b);
            } else {
                stk.push(dbl(s));
            }
        }
        cout.precision(6);
        cout << fixed << stk.top() << endl;
    }
    return 0;
}