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

deque<string> split_words(string s){
	bool flag = false;
	deque<string> words;
	string str;
	s.push_back(' ');

	for(unsigned int i=0 ; i < s.size() ; ++i ){
		char c = s[i];
		if( flag == false ){
			if( c != ' ' ){
				flag = true;
				str.clear();
				str.push_back( c );
			}
		}else{
			if( c != ' ' ){
				str.push_back( c );
			}
			if( c == ' ' ){
				flag = false;
				words.push_back( str );
				str.clear();
			}
		}
	}
	return words;
}

bool isOperator(string s){
	return ( s == "+" || s == "-" || s == "*" || s == "/" )? true : false ;
}

int s_to_i(string s){
	bool flag = false;
	int n = 0;

	for(unsigned int i=0 ; i < s.size() ; ++i ){
		if( i == 0 && s[i] == '-'){
			flag = true;
		}else{
			n *= 10;
			n += s[i] - '0';
		}
	}
	return (flag)? -n : n ;
}

double accum(double a, double b, string s){
	if( s == "+" )
		return a+b;
	else if( s == "-" )
		return a-b;
	else if( s == "*" )
		return a*b;
	else if( s == "/" )
		return a/b;
	return 0;
}


int main(){
	string s;
	while( getline( cin , s ) ){
		deque<string> words = split_words( s );
		stack<double> n;

		while( !words.empty() ){
			deque<string>::iterator it = words.begin();
			string str = *it;
			words.erase(it);
			if( isOperator( str ) ){
				double a = n.top();
				n.pop();
				double b = n.top();
				n.pop();
				n.push( accum( b , a , str ) );
			}else{
				n.push( s_to_i( str ) );
			}
		}
		printf("%.6lf\n", n.top() );
	}
}