#include <string>
#include <vector>
#include <iomanip>
#include <iostream>
using namespace std;
string s;
vector<string> parse(string str) {
	vector<string> ret; string t; str += " ";
	for(int i = 0; i < str.size(); i++) {
		if(str[i] == ' ') ret.push_back(t), t = "";
		else t += str[i];
	}
	return ret;
}
int main() {
	while(s = "", getline(cin, s)) {
		vector<string> v = parse(s);
		vector<double> w;
		for(int i = 0; i < v.size(); i++) {
			double a, b;
			if(w.size() > 1) a = *(w.end() - 2), b = *(w.end() - 1);
			if(v[i] == "+") *(w.end() - 2) = a + b, w.pop_back();
			else if(v[i] == "-") *(w.end() - 2) = a - b, w.pop_back();
			else if(v[i] == "*") *(w.end() - 2) = a * b, w.pop_back();
			else if(v[i] == "/") *(w.end() - 2) = a / b, w.pop_back();
			else w.push_back(stoi(v[i]));
		}
		cout << fixed << setprecision(12) << *(w.end() - 1) << endl;
	}
}