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

string str;

int main(){
	while(getline(cin,str)){
		stack<double> st;
		for(int i = 0; i < str.size(); i++){
			if(str[i] == ' ') continue;
			if(str[i]-'0' >= 0 && str[i]-'0' <= 9){
				if(i != 0 && str[i-1]-'0'>=0 && str[i-1]-'0'<=9){
					double p = st.top(); st.pop();
					p *= 10.0;
					p += (double)(str[i]-'0');
					st.push(p);
				} else if(i!=0&&str[i-1]=='-'){
					double p = (double)(str[i]-'0');
					p *= -1.0;
					st.push(p);
				} else {
					st.push((double)(str[i]-'0'));
				}
			}
			else if(str[i] == '+'){
				double p = st.top(); st.pop();
				double q = st.top(); st.pop();
				st.push(p+q);
			} else if(str[i] == '-'){
				if(i!=str.size()-1&&str[i+1]-'0'>=0&&str[i+1]-'0'<=9) continue;
				double p = st.top(); st.pop();
				double q = st.top(); st.pop();
				st.push(q-p);
			} else if(str[i] == '*'){
				double p = st.top(); st.pop();
				double q = st.top(); st.pop();
				st.push(p*q);
			} else if(str[i] == '/'){
				double p = st.top(); st.pop();
				double q = st.top(); st.pop();
				st.push(q/p);
			}
		}
		printf("%.7f\n", st.top());
	}
}