#include <cstdio>
#include <cstdlib>
#include <stack>
using namespace std;

int main()
{
	char str[128];
	
	while (fgets(str, 100, stdin) != NULL){
		stack<double> stk;
		int i, j;
		
		for (i = 0; str[i] != '\n'; i += j){
			char sub[16] = {0};
			for (j = 0; str[i + j] != ' ' && str[i + j] != '\n'; j++){
				sub[j] = str[i + j];
			}
			while (str[i + j] == ' ') j++;
			if ('0' <= sub[0] && sub[0] <= '9'){
				stk.push(atoi(sub));
			}
			else {
				double a, b;
				double res;
				
				a = stk.top(); stk.pop();
				b = stk.top(); stk.pop();
				switch (sub[0]){
					case '+':
						res = b + a;
						break;
					case '-':
						res = b - a;
						break;
					case '*':
						res = b * a;
						break;
					case '/':
						res = b / a;
						break;
				}
				stk.push(res);
			}
		}
		printf("%f\n", stk.top());
	}
	
	return 0;
}