#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <cctype>
#include <algorithm>
using namespace std;

bool isdigit(char c){
	if(c>='0' && c<='9') return true;
	return false;
}

int main(){
	int num=0;
	double p,q;
	stack<double> st;
	string s;
	int sign=1;
	while(getline(cin,s)){
		s = s + " ";
		for(int i=0;i<s.length();++i){
			if(isdigit(s[i])){
				num*=10;
				num+=s[i]-'0';
			} else if(s[i]=='-' && isdigit(s[i+1])){
				sign=-1;
			} else if(s[i]==' ' && isdigit(s[i-1])){
				num=num*sign;
				st.push(num);
				num=0;
				sign=1;
			} else if (s[i]=='+' || s[i]=='-' || s[i]=='*' || s[i]=='/'){
				p=st.top();
				st.pop();
				q=st.top();
				st.pop();
				if(s[i]=='+') st.push(p+q);
				if(s[i]=='-') st.push(q-p);
				if(s[i]=='*') st.push(p*q);
				if(s[i]=='/') st.push(q/p);
				}
				
			}
		cout << fixed << setprecision(9) << st.top() << endl;
		st.pop();
	}
	return 0; 
}