#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>

#define N_MAX 500
#define NUM 0

int getop(char []);
int getch(void);
void ungetch(int);
void push(double);
double pop(void);

char buf[N_MAX];
double val[N_MAX];
int bufp=0;
int top=0;

int main(){
  int i=0;
  int x;
  int kind;
  char n[N_MAX];
  
  scanf("%s",n);
  while((kind = getop(n))!=EOF){
    switch(kind){
    case NUM:
      push(atof(n));
      break;
    case '+':
      push(pop()+pop());
      break;
    case '-':
      x = pop();
      push(pop()-x);
      break;
    case '*':
      push(pop()*pop());
      break;
    case '/':
      x = pop();
      push(pop()/x);
      break;
    }
  }
  printf("%s\n",n);
  return 0;
}
//--------------------------
void push(double f){
  if(top<N_MAX){
    val[top++]=f;
  }
}
//--------------------------
double pop(void){
  if(top>0){
    return val[--top];
  }else{
    printf("stack empty\n");
    return 0;
  }
}
//-------------------------
int getop(char s[]){
  int i,c;

  while((s[0]=c=getch())==' '||c=='\t');
  s[1]='\0';
  if(!isdigit(c)&&c!='.'){
    return c;
  }
  i=0;
  if(isdigit(c)){
    while(isdigit(s[++i]=c=getch()));
  }
  s[i]='\0';
  if(c!=EOF){
    ungetch(c);
  }
  return NUM;
}
//---------------------------
int getch(){
  return (bufp>0) ? buf[--bufp]:getchar();
}
//--------------------------
void ungetch(int c){
  if(bufp >= N_MAX){
    ;
  }else{
    buf[bufp++]=c;
  }
}

