#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
using namespace std;

int main(){
	// sankou http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=546884#1
	string in_line, in;

	while (getline(cin, in_line)){
		stack<double> sta;
		istringstream stream(in_line);
		while (stream >> in){
			if (isdigit(in[0]) || in.length() >= 2){
				// 文字列inは数値なのでpushする.
				// string -> char -> double
				sta.push(atof(in.c_str()));
			}
			else{
				// a+b a-b a*b a/b
				double b = sta.top(); sta.pop();
				double a = sta.top(); sta.pop();

				double temp = 0.0;
				if (in[0] == '+')			temp = a + b;
				else if (in[0] == '-')		temp = a - b;
				else if (in[0] == '*')		temp = a * b;
				else						temp = a / b;
				sta.push(temp);
			}
		}
		printf("%.7lf\n", sta.top());
	}
	return 0;
}