#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> PI;
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair
#define PB push_back

double cal(double l,double r,char op){
  switch(op){
  case '+':return l+r;
  case '-':return l-r;
  case '*':return l*r;
  case '/':return l/r;
  }
}

int main(){
  string str;
  while(getline(cin,str)){
    stringstream ss(str);
    stack<double> por;
    string op;
    while(ss>>op){
      if(isdigit(op[0]) || op.size()>1)por.push(atof(op.c_str()));
      else{
        double r=por.top();por.pop();
        double l=por.top();por.pop();
        por.push(cal(l,r,op[0]));
      }
    }
    double ans=por.top();
    printf("%.8f\n",ans);
  }
}