#include<stdio.h>
#include<string.h>
#include<stdlib.h>

void push(double *stack,int data,int *sp);
double pop(double *stack,int *sp);
double calc(double n,double m,char c);

int main(void){
  double stack[128];
  int n,i;
  char str[128],*adr;
  //int l;
  fgets(str,sizeof(str),stdin);
  adr=strtok(str," \n");
  n=0;
  for(i=0;i<128;i++) stack[i]=0;
  //l=strlen(adr);
  //printf("%s\n",adr);
  while(adr!=NULL){
    //printf("%s\n",adr);
    if(strcmp(adr,"+")==0){
      stack[n-2]+=stack[n-1];
      n--;
    }else if(strcmp(adr,"-")==0){
      stack[n-2]-=stack[n-1];
      n--;
    }else if(strcmp(adr,"*")==0){
      stack[n-2]*=stack[n-1];
      n--;
    }else if(strcmp(adr,"/")==0){
      stack[n-2]/=stack[n-1];
      n--;
    }else{
      stack[n]=atof(adr);
      //printf("%s\n",adr);
      n++;
    }
    //printf("%f\n",stack[n-1]);
    adr=strtok(NULL," \n");
  }
  printf("%f\n",stack[0]);
  return 0;
}