#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<stack>
using namespace std;
int main(){
    string str;
    while(getline(cin,str)){
        stack<double> S;
        double now=0;
        for(int i=0;i<str.size();i++){
            if('0'<=str[i]&&str[i]<='9'){
                now=now*10+(str[i]-'0');
            }
            else if(str[i]==' '&&'0'<=str[i-1]&&str[i-1]<='9'){
                S.push(now),now=0;
            }
            else if(str[i]!=' '){
                int a,b;
                b=S.top();S.pop();
                a=S.top();S.pop();
                if(str[i]=='+')S.push(a+b);
                if(str[i]=='-')S.push(a-b);
                if(str[i]=='*')S.push(a*b);
                if(str[i]=='/')S.push(a/b);
            }
        }
        printf("%.12f\n",S.top());
    }
    return 0;
}