#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e8;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	string s;
	while(getline(cin,s)){
		//cout<<s<<endl;
		vector<string>in;
		int b=0;
		rep(i,s.size()){
			if(s[i]==' '){
				in.pb(s.substr(b,i-b));
				b=i+1;
			}	
		}
		in.pb(s.substr(b));
		vector<double>out;
		rep(i,in.size()){
			if(in[i]=="+"||in[i]=="-"||in[i]=="*"||in[i]=="/"){
				double a=out[out.size()-2];
				double b=out[out.size()-1];
				out.pop_back();
				out.pop_back();
				//cout<<a<<" "<<b<<endl;
				if(in[i]=="+")a+=b;
				if(in[i]=="-")a-=b;
				if(in[i]=="*")a*=b;
				if(in[i]=="/")a/=b;
				out.pb(a);
				//rep(j,out.size())cout<<out[i]<<" ";
				//cout<<endl;
			}else out.pb(atoi(&in[i][0]));
			//rep(j,out.size())cout<<out[j]<<" ";
			//cout<<endl;
		}
		printf("%.9lf\n",out[0]);
	}
}