#include<iostream>
#include<stack>
#include<string>
using namespace std;
int main() {
	string s;
	while (getline(cin, s)) {
		s += ' ';
		stack<double>stk;
		string str;
		for (int i = 0; i < s.size(); i++) {
			if (s[i] == ' ') {
				if (str == "+") {
					double b = stk.top(); stk.pop();
					double a = stk.top(); stk.pop(); 
					stk.push(a + b);
				}
				else if (str == "-") {
					double b = stk.top(); stk.pop();
					double a = stk.top(); stk.pop();
					stk.push(a - b);
				}
				else if (str == "*") {
					double b = stk.top(); stk.pop();
					double a = stk.top(); stk.pop();
					stk.push(a * b);
				}
				else if (str == "/") {
					double b = stk.top(); stk.pop();
					double a = stk.top(); stk.pop();
					stk.push(a / b);
				}
				else stk.push(stoi(str));
				str = "";
			}
			else str += s[i];
		}
		printf("%.10f\n", stk.top());
	}
}