#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

vector<string> split_naive(const string &s, char delim) {
	vector<string> elems;
	string item;
	for(char ch:s){
		if(ch==delim){
			if(!item.empty()) elems.push_back(item);
			item.clear();
		}
		else{
			item += ch;
		}
	}
	if(!item.empty()) elems.push_back(item);
	return elems;
}

int main(){
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	char S[1000];
	while(cin.getline(S,sizeof(S))){
		auto SS=split_naive(S,' ');
		stack<string> Stack;
		for(int i=0,ei=SS.size();i<ei;i++){
			char str[1000];
			if(SS[i]=="+"){
				auto r = Stack.top();
				Stack.pop();
				auto l = Stack.top();
				Stack.pop();
				double vr,vl;
				sscanf(r.c_str(),"%lf",&vr);
				sscanf(l.c_str(),"%lf",&vl);
				sprintf(str,"%.10lf",vr+vl);
				Stack.push(str);
			}
			else if(SS[i]=="-"){
				auto r = Stack.top();
				Stack.pop();
				auto l = Stack.top();
				Stack.pop();
				double vr,vl;
				sscanf(r.c_str(),"%lf",&vr);
				sscanf(l.c_str(),"%lf",&vl);
				sprintf(str,"%.10lf",vl-vr);
				Stack.push(str);
			}
			else if(SS[i]=="*"){
				auto r = Stack.top();
				Stack.pop();
				auto l = Stack.top();
				Stack.pop();
				double vr,vl;
				sscanf(r.c_str(),"%lf",&vr);
				sscanf(l.c_str(),"%lf",&vl);
				sprintf(str,"%.10lf",vl*vr);
				Stack.push(str);
			}
			else if(SS[i]=="/"){
				auto r = Stack.top();
				Stack.pop();
				auto l = Stack.top();
				Stack.pop();
				double vr,vl;
				sscanf(r.c_str(),"%lf",&vr);
				sscanf(l.c_str(),"%lf",&vl);
				sprintf(str,"%.10lf",vl/vr);
				Stack.push(str);
			}
			else Stack.push(SS[i]);
		}
		auto v = Stack.top();
		double d;
		sscanf(v.c_str(),"%lf",&d);
		if(abs(d)<=1e-7) d=0;
		printf("%.6lf\n",d);
	}
	return 0;
}
