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

using namespace std;

bool inNumber(char c){
	if('0'<=c&&c<='9')return true;
	return false;
}

int main(){
	string s;
	
	while(getline(cin,s)){
		int maFlag=1;
		double n=0.0;
		stack <double>st;
		s+=" ";
		
		for(int i=0;i<s.size();i++){
			char c=s[i];
			if( c == '-' && inNumber(s[i+1])){ // 負の数を表す'-'だったとき
        maFlag = -1;
			}else if(c==' '&&inNumber(s[i-1])){
				n=maFlag*n;
				st.push(n);
				n=0.0;
				maFlag=1;
			}else if(inNumber(c)){
			n*=10;n+=c-'0';
			}else if(c=='-'||c=='+'||c=='*'||c=='/'){
				double a=st.top();
				st.pop();
				double b=st.top();
				st.pop();
				if(c=='-')st.push(a-b);
				if(c=='+')st.push(a+b);
				if(c=='*')st.push(a*b);
				if(c=='/')st.push(a/b);
			}
		}
		printf("%.8f\n",st.top());
	}

}