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

using std::cin;
using std::cout;
using std::endl;
using std::getline;
using std::set;
using std::stack;
using std::stod;
using std::string;
using std::stringstream;
using std::vector;

double calculate(vector<string> rpev) {
	set<string> op {"+","-","*","/"}; // operator set
	stack<double> num_s; // number stack
	for (auto i = rpev.begin();i != rpev.end();++i) {
		if (op.find(*i) == op.end()) { // if *i is a number
			num_s.push(stod(*i));
		} else { // if *i is an operator
			double second = num_s.top();
			num_s.pop();
			double first = num_s.top();
			num_s.pop();
			if (*i == "+") {
				num_s.push(first+second);
			} else if (*i == "-") {
				num_s.push(first-second);
			} else if (*i == "*") {
				num_s.push(first*second);
			} else {
				num_s.push(first/second);
			}
		}
	}
	return num_s.top();
}

int main() {
	string rpe; // reverse Polish expression
	while (getline(cin,rpe)) {
		vector<string> rpev; // reverse Polish expression vector
		stringstream str_in(rpe);
		while (!str_in.eof()) {
			string unit;
			str_in >> unit;
			rpev.push_back(unit);
		}
		cout << calculate(rpev) << endl;
	}
}