#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;
using namespace std;
#include<stack>
#include<iomanip>
double Z(string s){
	if(s.size()==1){
		if(s[0]=='+')return 0.1;
		if(s[0]=='-')return 0.2;
		if(s[0]=='*')return 0.3;
		if(s[0]=='/')return 0.4;
		return s[0]-'0'+0.0;
	}
	double tmp=(s[0]=='-'?0:s[0]-'0')+0.0;
	for(int i=1;i<s.size();i++){
		tmp*=10;
		if(tmp<=0)tmp-=s[i]-'0'+0.0;
		else tmp+=s[i]-'0'+0.0;
	}
	return tmp;
}
int main(){
	string s;
	while(getline(cin,s)){
		stack<double> st;
		s.push_back(' ');
	int left=0;
	for(int i=0;i<s.size();i++){
		if(s[i]==' '){
			double tmp=Z(s.substr(left,i-left));
			if(0<tmp&&tmp<1){
				double b=st.top();st.pop();
				double a=st.top();st.pop();
				if(tmp==0.1)st.push(a+b);
				if(tmp==0.2)st.push(a-b);
				if(tmp==0.3)st.push(a*b);
				if(tmp==0.4)st.push(a/b);
			}
			else st.push(tmp);
			left=i+1;
		}
	}
	cout<<fixed<<setprecision(10)<<st.top()<<endl;
	}
	return 0;
}