#include <iostream>
#include <sstream>
#include <string>
#include <stack>
#include <stdlib.h>
using namespace std;

int main()
{
    string s;
    while(getline(cin, s))
    {
        stringstream ss;
        ss << s;
        stack<double> st;
        while(ss >> s)
        {
            if((s[0] >= '0' && s[0] <= '9') || s.size() > 1)
            {
                st.push(atoi(s.c_str()));
            }
            else
            {
                double a, b, x;
                b = st.top();
                st.pop();
                a = st.top();
                st.pop();
                if(strcmp(s.c_str(), "+") == 0)
                    x = a+b;
                else if(strcmp(s.c_str(), "-") == 0)
                    x = a-b;
                else if(strcmp(s.c_str(), "/") == 0)
                    x = a/b;
                else if(strcmp(s.c_str(), "*") == 0)
                    x = a*b;
                st.push(x);
                
            }
        }
        double result = st.top();
        cout << result << endl;
        
        
        
    }
    return 0;
}