#include <bits/stdc++.h>

using namespace std;

int main() {
    string s;
    while (getline(cin, s)) {
        stringstream ss;
        ss << s;

        string w;
        stack<double> st;
        while (ss >> w) {
            int sz = w.size();
            if (isdigit(w[sz - 1])) st.push(atof(w.c_str()));
            else {
                double a, b;
                b = st.top(); st.pop();
                a = st.top(); st.pop();

                switch (w[0]) {
                    case '+': st.push(a + b); break;
                    case '-': st.push(a - b); break;
                    case '*': st.push(a * b); break;
                    case '/': st.push(a / b); break;
                }
            }
        }

        printf("%.10f\n", st.top());
    }

    return 0;
}
