#include<iostream>
#include<string.h>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

int main()
{
  char str[100];
  stack<double> sta;
  int i,j;
  double first,second;
  stack<double> num;

  while(gets(str)!=NULL){
    rep(i,strlen(str)){

      if(str[i]>='0' && str[i]<='9')
	num.push(str[i]-'0');

      else if(str[i]==' '){
	if(num.size()){
	  int a=1,sum=0;
	  while(num.size()){
	    sum+=num.top()*a;
	    num.pop();
	    a*=10;
	  }
	  sta.push(sum);
	}

      }else{
	  first=sta.top();
	  sta.pop();
	  second=sta.top();
	  sta.pop();

	  switch(str[i]){
	  case '+' :sta.push(second+first);break;
	  case '-' :sta.push(second-first);break;
	  case '*' :sta.push(second*first);break;
	  case '/' :sta.push(second/first);break;
	  }
	}

    }
    printf("%f\n",sta.top());
    sta.pop();
  }
}