#include <iostream>
#include <stack>
#include <sstream>
int main(){
	std::string expr;
	while(std::getline(std::cin, expr)){
		expr += " ";
		std::stack<double> stack;
		int pre = 0, pos = 0;
		while(pos = expr.find(" ", pos), pos != std::string::npos){
			std::string term = expr.substr(pre, pos-pre);
			double push_date = 0;
			if(term == "+"){
				push_date = stack.top();
				stack.pop();
				push_date += stack.top();
				stack.pop();
			}
			else if(term == "-"){
				push_date = stack.top();
				stack.pop();
				push_date = stack.top() - push_date;
				stack.pop();
			}
			else if(term == "*"){
				push_date = stack.top();
				stack.pop();
				push_date *= stack.top();
				stack.pop();
			}
			else if(term == "/"){
				push_date = stack.top();
				stack.pop();
				push_date = stack.top() / push_date;
				stack.pop();
			}
			else{
				std::stringstream ss;
				ss << term;
				ss >> push_date;
			}
			stack.push(push_date);
			pre = pos+1;
			pos++;
		}
		std::cout << stack.top() << std::endl;
	}
}