#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
using namespace std;
int main() {
	string a;
	while (getline(cin,a)) {
		stack<long double>s;
		a += " ";
		string h = "";
		double ans = 0;
		bool ans2 = false;
		for (int i = 0; i < a.length(); i++) {
			if (a[i] == ' ') {
				if (h == "-") {
					long double d = s.top();
					s.pop();
					long double e = s.top();
					s.pop();
					s.push(e - d);
				}
				else if (h == "+") {
					long double d = s.top();
					s.pop();
					long double e = s.top(); s.pop();
					s.push( d+e);
				}
				else if (h == "*") {
					long double d = s.top();
					s.pop();
					long double e = s.top(); s.pop();
					s.push(d*e);
				}
				else if (h == "/") {
					long double d = s.top();
					s.pop();
					long double e = s.top(); s.pop();
					s.push(e / d);
				}
				else {
					s.push(stoi(h));
				}
				h = "";
			}
			else h += a[i];
		}
		cout << s.top() << endl;
	}
}