#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

vector<string> split(const string &str, char sep)
{
  vector<string> v;
  auto first = str.begin();
  while( first != str.end() ) {
    auto last = first;
    while( last != str.end() && *last != sep ) ++last;
    v.push_back(std::string(first, last));
    if( last != str.end() ) ++last;
    first = last;
  }
  return v;
}

signed main(void)
{
  string s;
  while(getline(cin, s)) {
    vector<string> v = split(s, ' ');
    stack<double> st;
    //for(string i: v) cout << i << " "; cout << endl;
    for(string i: v) {
      if(i == "-") {
        double a = st.top(); st.pop();
        double b = st.top(); st.pop();
        st.push(b-a);
      } else if(i == "+") {
        double a = st.top(); st.pop();
        double b = st.top(); st.pop();
        st.push(a+b);
      } else if(i == "*") {
        double a = st.top(); st.pop();
        double b = st.top(); st.pop();
        st.push(a*b);
      } else if(i == "/") {
        double a = st.top(); st.pop();
        double b = st.top(); st.pop();
        st.push(b/a);
      } else {
        st.push(stoi(i));
      }
      //cout << st.top() << endl;
    }
    cout << fixed << setprecision(15) << st.top() << endl;
  }

  return 0;
}