#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;
		bool hantei = false;
		for (int i = 0; i < b.size(); i++) {
			if (0 <= b[i]-'0' && b[i]-'0' <= 9) {
				hantei = true;
				counter *= 10.0;
				counter += b[i]-'0';
			} else if (b[i] == ' ') {
				if (hantei) {
					stk.push(counter);
					counter = 0.0;
					hantei = false;
				}
			} else {
				if (b[i] != '-') {
					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 {
						stk.push(s2/s1);
					}
				} else {
					if (i != b.size()-1 && 0 <= b[i+1]-'0' && b[i+1]-'0' <= 9) {
						hantei = true;
						counter += -b[i+1]-'0';
					} else {
						double s1, s2;
						s1 = stk.top();
						stk.pop();
						s2 = stk.top();
						stk.pop();
						stk.push(s2-s1);
					}
				}
			}
		}
		printf("%.6f\n", stk.top());
	}
	return 0;
}