#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <bitset>
#include <complex>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl;
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef complex<double> CD;

//文字列分割
VS split(string str, char del) {
	VS re;
	string sub;
	for (char c : str) {
		if (c == del) {
			re.pb(sub);
			sub.clear();
		}
		else {
			sub += c;
		}
	}
	re.pb(sub);
	return re;
}

int main() {
	string line;
	while (getline(cin, line)) {
		VS s = split(line, ' ');

		stack<double> st;

		for (auto t : s) {

			if (!isdigit(t[0]) && t.size() == 1) {
				double x = st.top(); st.pop();
				double y = st.top(); st.pop();

				double ans;
				switch (t[0]) {
				case '+':
					ans = y + x;
					break;
				case '-':
					ans = y - x;
					break;
				case '*':
					ans = y * x;
					break;
				case '/':
					ans = y / x;
					break;
				}

				st.push(ans);
				//cout << x << ", " << y << " = " << ans << endl;
			}
			else {
				int x = stoi(t);
				st.push((double)x);
			}

		}

		printf("%.20f\n", st.top());
	}
}
