#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>
using namespace std;
int main(){
	string s;
	while(getline(cin,s)){
		istringstream is(s);
		string t;
		double n[80];
		int c = -1;
		while(is >> t){
			istringstream it(t);
			char a;
			it >> a;
			     if(a=='+'){ c--; n[c] = n[c] + n[c+1]; }
			else if(a=='-'){ c--; n[c] = n[c] - n[c+1]; }
			else if(a=='*'){ c--; n[c] = n[c] * n[c+1]; }
			else if(a=='/'){ c--; n[c] = n[c] / n[c+1]; }
			else{
				istringstream itt(t);
				c++;
				itt >> n[c];
			}
		}
		cout << fixed << setprecision(8) << n[0] << endl;
	}
}