#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<queue>
#include<stack>
#include<complex>
#include<utility>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pi acos(-1)
#define all(v) v.begin(),v.end()
using namespace std;

const double eps = 1e-8;
const double INF = 1e12;

typedef pair<int,int> P;
typedef double Real;
typedef complex<Real> Point;
typedef vector<Point> G;

double cross(const Point& a,const Point& b){//calculate ad-bc(vector product)
	return imag(conj(a)*b);
}

struct L:public vector<Point>{//line data
	L(const Point &a,const Point &b){
		push_back(a);
		push_back(b);
	}
};

int stoi(string s){
	int size=s.size();
	int sum=0;
	rep(i,size){
		sum+=(int)(s[i]-'0')*pow(10,size-1-i);
	}
	return sum;
}

int main(){
	stack<double> st;
	string s;
	int test;
	while(getline(cin,s)){
		int cnt=0;
		rep(i,s.size()){
			if(isdigit(s[i])){
				continue;
			}else if(s[i]==' '){
				string sub=s.substr(cnt,i-cnt);
				cnt=i+1;
				if(!sub.size())continue;
				st.push(stoi(sub));
			}else{
				double a=st.top();
				st.pop();
				double b=st.top();
				st.pop();
				if(s[i]=='+'){
					st.push(a+b);
				}else if(s[i]=='-'){
					st.push(b-a);
				}else if(s[i]=='*'){
					st.push(a*b);
				}else{
					st.push(b/a);
				}
				cnt=i+1;
			}
		}
		cout<<st.top()<<endl;
		while(!st.empty())st.pop();
	}
	return 0;
}