#include<iostream>
#include<cstdlib>
#include<stack>
#include<string>
#include<cctype>
using namespace std;
int main(){
    stack<double>S;
    string str;
    while(cin>>str){
        if(isdigit(str[0])){
            double d=(double)atoi(str.c_str());
            S.push(d);
        }
        else{
            char ope=str[0];
            int d1=S.top();S.pop();
            int 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;
}