#include <cstdlib>
#include <iostream>
#include <string>
#include <typeinfo>
#include <stdio.h>
#include <string.h>
#include <stack>
#include <sstream>
using namespace std;

void q87() {
	string inputs;
	for (; getline(cin,inputs);) {
		istringstream ss(inputs);
		stack<double> stk;
		string input;
		for (; getline(ss, input, ' ');) {
			if (input == "0" || atoi(input.c_str()) != 0) {
				stk.push((double)atoi(input.c_str()));
			}

			else {
				if (input == "+") {
					double b = stk.top(); stk.pop();
					double a = stk.top(); stk.pop();
					stk.push(a + b);
				}
				else if (input == "-") {
					double b = stk.top(); stk.pop();
					double a = stk.top(); stk.pop();
					stk.push(a - b);
				}
				else if (input == "*") {
					double b = stk.top(); stk.pop();
					double a = stk.top(); stk.pop();
					stk.push(a * b);
				}
				else if (input == "/") {
					double b = stk.top(); stk.pop();
					double a = stk.top(); stk.pop();
					stk.push(a / b);
				}
			}
		}
		printf("%f\n",stk.top());
	}
}

int main() {
	q87();
	return 0;
}