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

stack<double> v;
string str;
int main(void){
    while(getline(cin,str)){
        stringstream ss(str);
        string num;
        while(ss >> num){
            if(num=="*"){
                double a=v.top();
                v.pop();
                double b=v.top();
                v.pop();
                v.push(a*b);
            }
            else if(num=="/"){
                double a=v.top();
                v.pop();
                double b=v.top();
                v.pop();
                v.push(b/a);
            }
            else if(num=="+"){
                double a=v.top();
                v.pop();
                double b=v.top();
                v.pop();
                v.push(a+b);
            }
            else if(num=="-"){
                double a=v.top();
                v.pop();
                double b=v.top();
                v.pop();
                v.push(b-a);
            }else{
                double c;
                stringstream numc;
                numc << num;
                numc >> c;
                v.push(c);
            }
        }
        double a=v.top();
        printf("%0.7f\n",a);
        v.pop();
    }
    return 0;
}