#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 200

void push(int);
int pop(void);

int top = 0;
int ss[100];

int main(){
  int x, ans;
  int n1, n2, num;
  char s[100];

  while(scanf("%s", s) != EOF){
    if(s[0] == '+'){
      n1 = pop();
      n2 = pop();
      num = n1 + n2;
      push(num);
    }else if(s[0] == '-'){
      n1 = pop();
      n2 = pop();
      num = n2 - n1;
      push(num);
    }else if(s[0] == '*'){
      n1 = pop();
      n2 = pop();
      num = n1 * n2;
      push(num);
    }else{
      x = atoi(s);
      push(x);
    }
  }
  ans = pop();
  printf("%d\n", num);

  return 0;
}

void push(int x){
  if(top >= MAX - 1){
    printf("overfullow\n");
  }
  top++;
  ss[top] = x;
}

int pop(void){
  if(top == 0){
    printf("underfullow\n");
  }
  top--;
  return ss[top+1];
}

