#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<assert.h>

#define MAX 100000

char input[MAX];
int stack_top;
double stack[MAX];

void push(double v) {
  stack[stack_top++] = v;
}

double pop() {
  return stack[--stack_top];
}

double getValue(int *ptr) {
  double value = 0;
  while( isdigit(input[*ptr]) ) {
    value *= 10;
    value += ( input[(*ptr)++]-'0' );
  }
  return value;
}

int main() {
  int i, len;
  while(fgets(input,sizeof input,stdin)) {
    len = strlen(input);
    for(i=0;i<len;++i) {
      while( i < len && input[i] == ' ' ) ++i;
      if( isdigit(input[i]) ) {
	push(getValue(&i));
	--i;
      } else if( input[i] == '+' ) {
	push(pop()+pop());
      } else if( input[i] == '-' ) {
	double v1 = pop();
	double v2 = pop();
	push(v2-v1);
      } else if( input[i] == '*' ) {
	push(pop()*pop());
      } else if( input[i] == '/' ) {
	double v1 = pop();
	double v2 = pop();
	push( v2 / v1 );
      } 
    }
    printf("%.10f\n",pop());
  }
  return 0;
}