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

string strOp = "*+-/";

double calc (double a, double b, string op) {
    if (op == "+") return a + b;
    else if (op == "-") return a - b;
    else if (op == "*") return a * b;
    else return a / b;
}

int main ()
{
    string str;
    while (getline (cin, str)) {
        stringstream ss;
        stack<double> V;
        ss << str;
        while (ss >> str) {
            if (strOp.find(str, 0) != string::npos) {
                double a, b;
                a = V.top(); V.pop();
                b = V.top(); V.pop();
                V.push(calc(b, a, str));
            } else {
                stringstream num;
                num << str;
                double n;
                num >> n;
                V.push(n);
            }
        }
        double ans = V.top();
        printf("%.6f\n", ans);
    }

    return 0;
}