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

void get_op(double* a, double* b, stack<double>* st)
{
    *a = st->top();
    st->pop();
    *b = st->top();
    st->pop();
}

int main()
{
    string line;

    while (getline(cin, line)){
        istringstream iss(line);
        stack<double> st;
        string s;

        while (iss >> s){
            double a, b;

            if (s == "+"){
                get_op(&a, &b, &st);
                st.push(b + a);
            }
            else if (s == "-"){
                get_op(&a, &b, &st);
                st.push(b - a);
            }
            else if (s == "*"){
                get_op(&a, &b, &st);
                st.push(b * a);
            }
            else if (s == "/"){
                get_op(&a, &b, &st);
                st.push(b / a);
            }
            else {
                st.push(atof(s.c_str()));
            }
        }
        printf("%f\n", st.top());
    }

    return (0);
}