#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
int main(void){
  char s[111];
  int sl;
  while(fgets(s,sizeof(s),stdin) != NULL){
    stack<long double> st;
    st.push(0);
    sl = strlen(s);
    long double n = 0;
    for(int i = 0; i < sl-1; i++){
      if(s[i] == ' ') {
	st.push(n);
	n = 0;
      }else if('0' <= s[i] && s[i] <= '9'){
	n *= 10;
	n += s[i]-'0';
	if(i == sl-2) st.push(n);
      }else{
	long double a = st.top(); st.pop();
	long double b = st.top(); st.pop();
	long double m;
	switch(s[i]){
	case '+' :m = b+a; break;
	case '-' :m = b-a; break;
	case '*' :m = b*a; break;
	case '/' :m = b/a; break;
	}
	st.push(m);
	i++;
      }
    }
    printf("%.10Lf\n",st.top());
  }
}