#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<list>
#include<stack>
#include<cstring>
#include<string>
#include<cmath>
using namespace std;

int main(){
	while(true){
		stack<double> s;
		char In[81];
		double num=0;
		bool is_pos=true;
		int r;
		for(int i=0;r=scanf("%c",&In[i]);i++){
			if(In[i]=='\n') break;
			if(r==EOF) return 0;
		}
		for(int i=0;In[i]!='\n';i++){
			if(In[i]==' ') continue;
			if('0'<=In[i] && In[i]<='9'){
				num = num*10+(In[i]-'0');
				if(In[i+1]==' '){
					if(is_pos==false) num *= -1;
					s.push(num);
					num = 0; is_pos = true;
				}
			}
			else{
				if(In[i]=='-' && '0'<=In[i+1] && In[i+1]<='9'){
					is_pos = false;
				}
				else{
					double a,b;
					b = s.top(); s.pop();
					a = s.top(); s.pop();
					if(In[i]=='+') s.push(a+b);
					else if(In[i]=='-') s.push(a-b);
					else if(In[i]=='*') s.push(a*b);
					else s.push(a/b);
				}
			}
		}
		printf("%lf\n",s.top());
	}
	return 0;
}