#include<iostream>
#include<stack>
#include<string>
using namespace std;

int main() {
	string s;
	while (getline(cin,s)) {
		stack<double>stk;
		string sa;
		
		for (int i = 0;i < s.size();i++) {
			if (s[i] != ' ') {
				sa+=(s[i]);
			}
			else {
					if (sa == "+") {
						double a = stk.top();
						stk.pop();
						double b = stk.top();
						stk.pop();
						stk.push(a + b);
					}
					else if (sa == "-") {
						double a = stk.top();
						stk.pop();
						double b = stk.top();
						stk.pop();
						stk.push(b - a);
					}
					else if (sa == "*") {
						double a = stk.top();
						stk.pop();
						double b = stk.top();
						stk.pop();
						stk.push(a*b);
					}
					else if (sa == "/") {
						double a = stk.top();
						stk.pop();
						double b = stk.top();
						stk.pop();
						stk.push(b / a);
					}
				else {
					int a = stoi(sa);
					stk.push(a);
				}
				sa.clear();
			}
		}
		if (!sa.empty()&&sa!="+"&&sa!="-"&&sa!="*"&&sa!="/")stk.push(stoi(sa));
		printf("%.9lf\n", stk.top());
	}
	return 0;
}