#include <cstdio>
#include <cstring>
using namespace std;

void push(double x);
double pop();

int top;
double stack[100];

int main() {
	int len, i, x, flag;
	double a, b;
	char str[100];
	while (gets(str) != NULL) {
		top = 0;
		len = strlen(str);
		for (i = 0; i < len; i++) {
			flag = 0;
			if ((str[i] == '-' && str[i+1] >= '0' && str[i+1] <= '9') || (str[i] >= '0' && str[i] <= '9')) {
				if (str[i] == '-' && str[i+1] >= '0' && str[i+1] <= '9') {
					flag = 1;
					i++;
				}
				for (x = 0; str[i] >= '0' && str[i] <= '9'; i++) {
					x = x * 10 + (str[i] - '0');
				}
				if (flag)
					x *= -1;
				push(x);
			} else if (str[i] == '+' || str[i] == '-' || str[i] == '*' || str[i] == '/') {
				b = pop();
				a = pop();
				switch (str[i]) {
				case '+':
					push(a+b);
					break;
				case '-':
					push(a-b);
					break;
				case '*':
					push(a*b);
					break;
				case '/':
					push(a/b);
					break;
				}
			}
		}
		printf("%lf\n", pop());
	}
	return 0;
}

void push(double x) {
	stack[top++] = x;
}

double pop() {
	return stack[--top];
}