#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>

using namespace std;

bool isop(string &s){
	return s == "+" || s == "*" || s == "/" || s == "-";
}

int main(){
	string s;
	while(getline(cin,s)){
		istringstream iss(s);
		stack<double> s;
		string b;
		while(iss>>b){

			if(!isop(b)){
				double x;
				sscanf(b.c_str(),"%lf",&x);
				s.push(x);
				continue;
			}

			switch(b[0]){
			case '+':{
				double x = s.top(); s.pop();
				double y = s.top(); s.pop();
				s.push(x+y);
				break;}
			case '-':{
				double x = s.top(); s.pop();
				double y = s.top(); s.pop();
				s.push(y-x);
				break;}
			case '*':{
				double x = s.top(); s.pop();
				double y = s.top(); s.pop();
				s.push(x*y);
				break;}
			case '/':{
				double x = s.top(); s.pop();
				double y = s.top(); s.pop();
				s.push(y/x);
				break;}
			}
		}
		printf("%lf\n",s.top());
	}
    return 0;
}