#include <iostream>
#include <cstdio>
#include <stack>
using namespace std;

int main(){
    while(1){
        stack<double> st;
        while(1){
            char tmp[128];
            if(scanf("%s", tmp) == EOF) return 0;
            if((tmp[0]=='+' || tmp[0]=='-' || tmp[0]=='*' || tmp[0]=='/')&& tmp[1] == '\0'){
                double a = st.top();
                st.pop();
                double b = st.top();
                st.pop();
                if(tmp[0] == '+') st.push(a+b);
                if(tmp[0] == '-') st.push(b-a);
                if(tmp[0] == '*') st.push(b*a);
                if(tmp[0] == '/') st.push(b/a);
            }else{
                double a;
                sscanf(tmp, "%lf", &a);
                st.push(a);
            }
            if(getchar() == '\n') break;
        }
        printf("%lf\n", st.top());
    }
    return 0;
}