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

int main()
{
	char str[2048];
	
	double stack[2048];
	
	while (fgets(str, 2048, stdin) != NULL){
		int len = strlen(str);
		
		int p = 0;
		int m = 0;
		
		while (p < len){
			if (str[p] >= '0' && str[p] <= '9'){
				sscanf(&str[p], "%lf", &stack[m++]);
				
				char w[128];
				sscanf(&str[p], "%s", w);
				
				p += strlen(w) + 1;
			}
			
			else {
				switch (str[p]){
					case '+':
					stack[m - 2] += stack[m - 1];
					break;
					
					case '-':
					stack[m - 2] -= stack[m - 1];
					break;
					
					case '*':
					stack[m - 2] *= stack[m - 1];
					break;
					
					case '/':
					stack[m - 2] /= stack[m - 1];
					break;
				}
				
				m--;
				p += 2;
				
//				printf("%lf\n", stack[m - 1]);
			}
		}
		
		printf("%lf\n", stack[0]);
	}
	
	return 0;
}