#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
#include <stack>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    while(getline(cin, s))
    {
        s += ' ';
        stack<double> st;
        int pos = 0;
        string tmp = "";
        while(pos < s.size())
        {
            if(s[pos] == ' ')
            {
                if(tmp == "+")
                {
                    double a = st.top(); st.pop(); 
                    double b = st.top(); st.pop();
                    st.push(a + b);
                }
                else if(tmp == "-")
                {
                    double a = st.top(); st.pop();
                    double b = st.top(); st.pop();
                    st.push(b - a);
                }
                else if(tmp == "*")
                {
                    double a = st.top(); st.pop();
                    double b = st.top(); st.pop();
                    st.push(a * b);
                }
                else if(tmp == "/")
                {
                    double a = st.top(); st.pop();
                    double b = st.top(); st.pop();
                    st.push(a / b);
                }
                else
                {
                    double v = stod(tmp);
                    st.push(v);
                }
                tmp = "";
            }
            else tmp += s[pos];
            pos++;
        }
        cout << st.top() << endl;
    }
    return 0;
}


