#include <iostream>
#include <stack>
#include <string>
using namespace std;

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

int main(){
	string s;
	while( getline(cin,s) ){
	 	int minusFlag = 1;
		double n = 0.0;
		stack<double> st;
		s += " ";

		for(int i=0 ; i < s.size() ; i++ ){
			char c = s[i];
			if( c == '-' && isNumber(s[i+1]) ){
				minusFlag = -1;
			}else if( isNumber(c) ){
				n *= 10.0;
				n += c - '0';
			}else  if( c == ' ' ){
				if( isNumber(s[i-1]) ){
					n = n * minusFlag;
					st.push( n );
					n = 0.0;
					minusFlag = 1;
				}
			}else if( c == '+' || c == '-' || c == '*' || c == '/' ){
				double a = st.top();
				st.pop();
				double b = st.top();
				st.pop();
				if( c == '+' ) st.push( b + a );
				if( c == '-' ) st.push( b - a );
				if( c == '*' ) st.push( b * a );
				if( c == '/' ) st.push( b / a );
			}
		}
		cout << st.top() << endl;
	}
}