#include <iostream>
#include <cstdio>
#include <stack>
#include <string>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	stack<double> s;
	string str;
	while(cin >> str) {
		if(isdigit(str[0])) {
			double n = atoi(str.c_str());
			s.push(n);
		} else {
			if(str == "+") {
				double a = s.top(); s.pop();
				double b = s.top(); s.pop();
				double c = a + b;
				s.push(c);
			}
			if(str == "-") {
				double a = s.top(); s.pop();
				double b = s.top(); s.pop();
				double c = b - a;
				s.push(c);
			}
			if(str == "*") {
				double a = s.top(); s.pop();
				double b = s.top(); s.pop();
				double c = a * b;
				s.push(c);
			}
			if(str == "/") {
				double a = s.top(); s.pop();
				double b = s.top(); s.pop();
				double c = b / a;
				s.push(c);
			}
		}
	}
	cout << s.top() << endl;
	return 0;
}