#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stack>
using namespace std;
int main(void){

    string str;
    while(getline(cin,str)){
        double ans = 0;
        stack<double> s;
        for(int i=0;i<str.size();i++){
            if('0'<=str[i]&&str[i]<='9'){
                double x = 0;
                for(int j=i;;j++){
                    if(j>=str.size()){
                        i = j;
                        s.push(x);
                        break;
                    }
                    else if(str[j]<'0'||'9'<str[j]){
                        i = j;
                        s.push(x);
                        break;
                    }
                    else{
                        x *= 10;
                        x += str[j] - '0';
                    }
                }

            }
            else if(str[i]=='+'||str[i]=='-'||str[i]=='*'||str[i]=='/'){
                double y = s.top();
                s.pop();
                double x = s.top();
                s.pop();
                if(str[i]=='+'){
                    s.push(x+y);
                }
                else if(str[i]=='-'){
                    s.push(x-y);
                }
                else if(str[i]=='*'){
                    s.push(x*y);
                }
                else if(str[i]=='/'){
                    s.push(x/y);
                }
            }

        }
        printf("%.6lf\n",s.top());
    }

    return 0;
}