#include<iostream>
#include<string>
#include<stack>
#include<vector>
#include<sstream>
#include<cstdio>

using namespace std;

int main(){
	
	string str;
	while(getline(cin,str)){
		
		stringstream sst;
		
		sst<<str;
		
		string tmp;
		stack<double> s;
		
		while(sst>>tmp){
			
			if(tmp=="*"){
				double b = s.top(); s.pop();
				double a = s.top(); s.pop();
				
				s.push(a*b);
			}else if(tmp=="/"){
				double b = s.top(); s.pop();
				double a = s.top(); s.pop();
				
				s.push(a/b);
			}else if(tmp=="+"){
				double b = s.top(); s.pop();
				double a = s.top(); s.pop();
				
				s.push(a+b);
			}else if(tmp=="-"){
				double b = s.top(); s.pop();
				double a = s.top(); s.pop();
				
				s.push(a-b);
			}else{
				double val;
				stringstream tmpsst;
				tmpsst<<tmp;
				tmpsst>>val;
				
				s.push(val);
			}
		}
		double val = s.top();
		printf("%.8lf\n",val);
	}
}