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

#define M 100
#define NUMBER '0'

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

int main(){
  int x;
  double y;
  char str[M];

  while((x = getop(str)) != EOF){
    switch (x){
    case NUMBER:
      push(atof(str));
      break;
    case '+':
      push(pop() + pop());
      break;
    case '-':
      y = pop();
      push(pop() - y);
      break;
    case '*':
      push(pop() * pop());
      break;
    case '\n':
      printf("%.8g\n", pop());
      break;
    default:
      printf("エラー\n");
      break;
    }   
  }
  return 0;
}

int sp = 0;
double val[M];

void push(double x){
  if (sp < M)
    val[sp++] = x;
  else
    printf("エラー（オーバーフロー）\n");
}

double pop(void){
  if (sp > 0)
    return val[--sp];
  else {
    printf("エラー（アンダーフロー）\n");
    return 0.0;
  }
}

int getch(void);
void ungetch(int);

int getop(char str[]){
  int i, c;

  while ((str[0]= c = getch()) == ' ' || c == '\t')
    
  str[1] = '\0';
  if (!isdigit(c) && c != '.')
    return c;
  i = 0;
  if (isdigit(c)) 
    while (isdigit(str[++i] = c = getch()))
      ;
  if (c == '.')
    while (isdigit(str[++i] = c = getch()))
      ;
  str[i] = '\0';
  if (c != EOF)
    ungetch(c);
  return NUMBER;
}

int getch(void) {
char buf[M];
int bufp =0;
  return (bufp > 0) ? buf[--bufp] : getchar();
}

void ungetch(int c){
char buf[M];
int bufp =0;
  if (bufp >= M)
    printf("ungetch: too many characters\n");
  else
    buf[bufp++] = c;
}