#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;




int main() {
	string s;
	while (getline(cin, s)) {
		stack<double> sta;
		int a = 0, b, c;
		bool f = false;
		for (int i = 0; i < s.size(); i++) {
			if (s[i] >= '0'&&s[i] <= '9') {
				a *= 10;
				a += s[i] - '0';
				f = true;
			}
			else if (s[i] == ' ') {
				if (f) {
					sta.push(a);
					a = 0;
					f = false;
				}
			}
			else {
				b = sta.top();
				sta.pop();
				c = sta.top();
				sta.pop();
				if (s[i] == '+') {
					sta.push(b + c);
				}
				else if (s[i] == '-') {
					sta.push(c - b);
				}
				else if (s[i] == '*') {
					sta.push(c * b);
				}
				else if (s[i] == '/') {
					sta.push((double)c / b);
				}
			}
		}
		cout << sta.top() << endl;
	}
}