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

int main()
{
	string str;
	
	while (getline(cin, str)){
		stack<double> st;
		stringstream ss;
		
		ss << str;
		string item;
		while (ss >> item){
			char c = item.at(0);
			
			if (c == '+' || (c == '-' && item.length() == 1) || c == '*' || c == '/'){
				double a, b;
				
				b = st.top(); st.pop();
				a = st.top(); st.pop();
				if (c == '+') st.push(a + b);
				else if (c == '-') st.push(a - b);
				else if (c == '*') st.push(a * b);
				else st.push(a / b);
			}
			else {
				st.push(atof(item.c_str()));
			}
		}
		printf("%f\n", st.top());
	}
	
	return 0;
}