#include<bits/stdc++.h>
using namespace std;
#define rep(i,a) for(int i = 0; i < (a); i++)
#define reps(i, a, b) for(int i = (a); i < (b); i++)
#define INF 1e9
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int, int> pii;
vector<string> split(const string &s, char delim) {
	vector<string> elem;
	stringstream ss(s);
	string item;
	while(getline(ss, item, delim)) {
		if(!item.empty()) {
			elem.push_back(item);
		}
	}
	return elem;
}
double calc(double num1, double num2, string s) {
	if(s == "+") return num1 + num2;
	if(s == "-") return num1 - num2;
	if(s == "*") return num1 * num2;
	else return num1 / num2;
}
int main() {
	string str;
	while(getline(cin, str)) {
		vector<string> hoge = split(str, ' ');
		stack<double> S;
		rep(i, hoge.size()) {
			if(hoge[i] == "-" || hoge[i] == "*" || hoge[i] == "/" || hoge[i] == "+") {
				int num1,num2;
				num2 = S.top();S.pop();
				num1 = S.top();S.pop();
				S.push(calc(num1, num2, hoge[i]));
			} else {
				double num;
				sscanf(hoge[i].c_str(), "%lf", &num);
				S.push(num);
			}
		}
		printf("%.7lf\n", S.top());
	}
	return 0;
}