#include<iostream>
#include<cstdlib>
#include<stack>
#include<string>
#include<cctype>
#include<sstream>
using namespace std;
int main(){
    string str;
    while(getline(cin,str)){
        stack<double>S;
        stringstream ss;
        ss<<str;
        while(ss>>str){
            if(str[0]>='0'&&str[0]<='9'||str.size()>1){
                S.push(atoi(str.c_str()));
            }
            else{
                char ope=str[0];
                double d1=S.top();S.pop();
                double d2=S.top();S.pop();
                if(ope=='+')S.push(d1+d2);
                else if(ope=='-')S.push(d2-d1);
                else if(ope=='*')S.push(d1*d2);
                else S.push(d2/d1);
            }
        }
        cout<<fixed<<S.top()<<endl;
    }
}