#include<iostream>
#include<stack>
#include<string>
#include<cstdio>
using namespace std;

int main(){

  string s;
  double x,y;

  while(getline(cin,s)){
    double k = 0;
    int p = 1;
    stack < double > a;

    for(int i=0;i<s.size();i++){
 
      if(s[i] == '+' || s[i] == '-' || s[i] == '*' || s[i] == '/'){
	x = a.top();
	if(!a.empty())a.pop();

	y = a.top();
	if(!a.empty())a.pop();

	if(s[i] == '+')	a.push(y+x);
	else if(s[i] == '-') a.push(y-x);
	else if(s[i] == '*') a.push(y*x);
	else if(x != 0 && s[i] == '/') a.push(y/x);
	
      }

      if(s[i] <=  '9' && s[i] >= '0'){
	k *= 10;
	k += (s[i] - '0');
	p = 0;
      }
 
      if(!p && s[i] == ' '){
	a.push(k);
	k = 0;
	p = 1;
      }

    }
    printf("%.6f\n",a.top());
  }
}