#include <iostream>
#include <stack>
#include <cstdio>
#include <cstring>
#include <string>
using namespace std;

int main() {
	char str[128];

	while(fgets(str, sizeof(str), stdin) != NULL) {
		stack<double> s;

		for(int i = 0; str[i] && str[i] != '\n';) {
			if(str[i] == ' ') i++;
			else if('0' <= str[i] && str[i] <= '9') {
				int p = 0;
				for(;str[i] && str[i] != ' ' && str[i] != '\n'; i++) {
					p *= 10;
					p += str[i] - '0';
				}
				s.push((double)p);
			}

			else if(str[i] == '-' && str[i + 1] != ' ' && str[i + 1] != '\n') {
				int p = 0;
				i++;
				for(;str[i] && str[i] != ' ' && str[i] != '\n'; i++) {
					p *= 10;
					p += str[i] - '0';
				}
				s.push((double)p * (-1));
			}

			else {
				double r, l;
				double p;
				r = s.top(); s.pop();
				l = s.top(); s.pop();

				switch(str[i]) {
					case '+':
						p = l + r;
						break;
					case '-':
						p = l - r;
						break;
					case '*':
						p = l * r;
						break;
					case '/':
						p = l / r;
						break;
				}
				s.push(p);
				i++;
			}
		}
		printf("%f\n", s.top());
	}
}