#include <iostream>
#include <cctype>
#include <stack>
#include <iomanip>
#include <string>

using namespace std;

int main()
{
    string inp;

    cout << fixed << setprecision(8);

    while (getline(cin, inp)) {

        stack<double> st;
        double n = 0.0;
        int minusFlag = 1;
        
        inp += " ";
        
        for (int i = 0; i < inp.size(); i++) {
            char c = inp[i];
            
            if (c == '-' && isdigit(inp[i + 1])) {
                minusFlag = -1;
            }
            else if (isdigit(c)) {
                n *= 10.0;
                n += c - '0';
            }
            else if (c == ' ' && isdigit(inp[i - 1])) {
                n = n * minusFlag;
                st.push(n);
                n = 0.0;
                minusFlag = 1;
            }
            else if (c == '+' || c == '-' || c == '*' || c == '/') {
                double a = st.top();
                st.pop();
                double b = st.top();
                st.pop();

                if (c == '+') 
                    st.push(b + a);
                else if (c == '-')
                    st.push(b - a);
                else if (c == '*')
                    st.push(b * a);
                else
                    st.push(b / a);
            }
        }
        cout << st.top() << endl;
    }

    return 0;
}