#include <bits/stdc++.h>
using namespace std;

#define DUMP(x) cerr << #x << "=" << x << endl
#define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<")"<< endl
#define BINARY(x) static_cast<bitset<16> >(x)

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

#define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()

typedef long long ll;
const int INF = 1e9;
typedef pair<int, int> PII;
int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1};

int main()
{
    string line;
    while (true) {
        getline(cin, line);
        if (cin.eof()) break;

        stack<double> st;
        stringstream ss(line);
        while (!ss.eof()) {
            string S; ss >> S;

            if (isdigit(S[0]) || S.size() > 1) {
                int num = stoi(S);
                st.push(num);
            } else {
                double b = st.top(); st.pop();
                double a = st.top(); st.pop();
                if (S == "-") st.push(a - b);
                if (S == "+") st.push(a + b);
                if (S == "*") st.push(a * b);
                if (S == "/") st.push(a / b);
            }
        }

        cout << fixed << setprecision(10) << st.top() << endl;
    }
}