#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define itrep(it, a) for(it = (a).begin(); it != (a).end(); it++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 30)
using namespace std;

string changeStr(int n){
    string str;
    int len = static_cast<int>(log10(n));
    int K = 1;
    if(n < 0) str+='-';
    rep(i,len) K*=10;
    rep(i,len + 1){
        if(n / K == 0) str+= '0';
        else str+= ('0' + n / K);
        n%=K; K/=10;
    }
    return str;
}

double changeNum(string str){
    double num = 0, K = 1;
    if(str[0] == '-'){
        for(int i = str.size() - 1; i >= 1; i--){
            num+=(str[i] - '0') * K;
            K*=10;
        }
        return num * -1;
    }else{
        for(int i = str.size() - 1; i >= 0; i--){
            num+=(str[i] - '0') * K;
            K*=10;
        }
        return num;
    }
}

void solve(stack<double> &st, char op){
    double a, b;
    b = st.top(); st.pop();
    a = st.top(); st.pop();

    if(op == '+') st.push(a + b);
    else if(op == '-') st.push(a - b);
    else if(op == '/') st.push(a / b);
    else st.push(a * b);
}

int main(){
    string str;
    while(getline(cin, str)){
        str+=' ';
        stack<double> st;
        string input;
        rep(i,str.size()){
            if(str[i] == ' '){
                if(input[0] >= '0' && input[0] <= '9'){
                    st.push(changeNum(input));
                }else{
                    solve(st, input[0]);
                }
                input = "";
            }else{
                input+=str[i];
            }
        }
        cout << st.top() << endl;
    }
}