#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<list>
#include<stack>
#include<cstring>
#include<string>
#include<cmath>
using namespace std;

int main(){
	while(true){
		stack<double> s;
		char In;
		int num=0;
		while(true){
			int r = scanf("%c",&In);
			if(r==EOF) return 0;
			if(In==' '){
				s.push(num);
				num = 0;
				continue;
			}
			if(In=='\n') break;
			if('0'<=In && In<='9'){
				num = num*10+(In-'0');
			}
			else{
				double a,b;
				b = s.top(); s.pop();
				a = s.top(); s.pop();
				if(In=='+') s.push(a+b);
				else if(In=='-') s.push(a-b);
				else if(In=='*') s.push(a*b);
				else s.push(a/b);
			}
		}
		printf("%lf\n",s.top());
	}
	return 0;
}