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

using namespace std;

int main() {
	string b;
	while (getline(cin, b)) {
		stack<double> stk;
		double counter = 0.0;
		for (int i = 0; i < b.size(); i++) {
			if (0 <= b[i]-'0' && b[i]-'0' <= 9) {
				counter *= 10.0;
				counter += b[i]-'0';
			} else if (b[i] == ' ') {
				if (counter > 0.0) {
					stk.push(counter);
					counter = 0.0;
				}
			} else {
				double s1, s2;
				s1 = stk.top();
				stk.pop();
				s2 = stk.top();
				stk.pop();
				if (b[i] == '+') {
					stk.push(s2+s1);
				} else if (b[i] == '-') {
					stk.push(s2-s1);
				} else if (b[i] == '*') {
					stk.push(s2*s1);
				} else {
					stk.push(s2/s1);
				}
			}
		}
		printf("%.6f\n", stk.top());
	}
	return 0;
}