#include <iostream>
#include <string>
#include <stack>
#include <sstream>
#include <cstdio>

using namespace std;

int main() {
	string a;
	while (getline(cin, a)) {
		bool hantei = true;
		stack<double> stk;
		while (hantei) {
			string b = "";
			while (true) {
				if (a[0] == ' ') {
					a = a.substr(1);
					break;
				} else if (a.size() == 1){
					b += a[0];
					hantei = false;
					break;
				} else {
					b += a[0];
					a = a.substr(1);
				}
			}
			if (b == "+") {
				double p = stk.top();
				stk.pop();
				double q = stk.top();
				stk.pop();
				stk.push(p+q);
			} else if (b == "-") {
				double p = stk.top();
				stk.pop();
				double q = stk.top();
				stk.pop();
				stk.push(q-p);
			} else if (b == "*") {
				double p = stk.top();
				stk.pop();
				double q = stk.top();
				stk.pop();
				stk.push(p*q);
			} else if (b == "/") {
				double p = stk.top();
				stk.pop();
				double q = stk.top();
				stk.pop();
				stk.push(q/p);
			} else {
				double k;
				stringstream ss;
				ss << b;
				ss >> k;
			    stk.push(k);
			}
		}
		printf("%.6f\n", stk.top());
	}
	return 0;
}