#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <bitset>
#include <complex>
using namespace std;
  
const double EPS = 1e-9;
const double PI = 3.14159265359;
  
typedef complex<double> P;
 
int main(){
    string s;
 
    while(getline(cin, s)){
        stack<double> st;
        stringstream ss;
 
        ss << s;
        while(ss >> s){
            if(s[0] >= '0' && s[0] <= '9' || s.size() > 1){
                st.push(atoi(s.c_str()));
            }else{
                double a, b;
                b = st.top();
                st.pop();
                a = st.top();
                st.pop();
                switch(s[0]){
                case '+':
                    st.push(a+b);
                    break;
                case '-':
                    st.push(a-b);
                    break;
                case '*':
                    st.push(a*b);
                    break;
                case '/':
                    st.push(a/b);
                    break;
                }
            }
        }
        printf("%lf\n", st.top());
    }
 
    return 0;
}