#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<complex>

#define f first
#define s second
#define mp make_pair

#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()

using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

#define MAX 1010

int main(){
  char buff[100];
  while(fgets(buff,sizeof(buff),stdin)){
    stack<double> st;
    for(char *p = buff; *p; p++) if(*p == '\n') *p = '\0';
    for(char *p = buff; *p; p++){
      if(*p == '+'){
	double op1,op2;
	op1 = st.top(); st.pop();
	op2 = st.top(); st.pop();
	st.push(op1 + op2);
      }else if(*p == '-' && (*(p+1) < '0' || *(p+1) > '9')){
	double op1,op2;
	op2 = st.top(); st.pop();
	op1 = st.top(); st.pop();
	st.push(op1 - op2);
      }else if(*p == '*'){
	double op1,op2;
	op1 = st.top(); st.pop();
	op2 = st.top(); st.pop();
	st.push(op1 * op2);
      }else if(*p == '/'){
	double op1,op2;
	op2 = st.top(); st.pop();
	op1 = st.top(); st.pop();
	st.push(op1 / op2);
      }else if(*p == ' '){
      }else{
	double op;
	sscanf(p, "%lf", &op);
	st.push(op);
	while((*p >= '0' && *p <='9') || (*p == '.') || (*p == '-')) p++;
      }
    }
    printf("%.6f\n",st.top());
  }
  return 0;
}