#include<stdio.h>
#include<stdlib.h>
#define MAX 100

int S[MAX];
int top;

void initialize(){
   top = 0;
 }

int isEmpty(){
   if(top==0)return 0;
   return -1;
}
 int isFull(){
   if(top>=MAX)return 0;
   return -1;
}

 void push(int x){
   if(isFull()==0){
     fprintf(stderr,"Push ERROR\n");
     exit(1);
   }
   top++;
   S[top] = x;
}

int pop(){
    if (isEmpty()==0){
      fprintf(stderr,"Pop ERROR\n");
      exit(2);
    }
      top--;
      return S[top+1];
}

int main(void){
  int num,N,Ans=0,i;
  char C;

  initialize();
  while(1){
    if(scanf("%c",&C)!='\n')break;

    if('1'<=C&&C<='9')num=1;
    else if(C=='+')num=2;
    else if(C=='-')num=3;
    else if(C=='*')num=4;
    else {
      fprintf(stderr,"Input ERROR\n");
      exit(3);
    }
    switch(num){
      case 1:/*数字*/
      N=atoi(&C);
      push(N);
            printf("数\n");
      break;

      case 2:/*足し算*/
      for(i=0 ; i<top-1 ; i++){
        Ans+=pop();
      }
      push(Ans);
            printf("たし算\n");
      break;

      case 3:/*引き算*/
      for(i=0 ; i<top-1 ; i++){
        if(i==0)Ans+=pop();
        else Ans-=pop();
      }
      push(Ans);
            printf("ひき\n");
      break;

      case 4:/*掛け算*/
      for(i=0 ; i<top-1 ; i++){
        Ans*=pop();
      }
      push(Ans);
      printf("掛け算\n");
      break;
    }
  }
  printf("%d\n",S[0]);
  return 0;
}

