#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 100
void push(int, int,int []);
int pop(int, int[]);

int main() {
	char array[1000000];
	char *pt=array,*tok;
	int top=0,result[N],num,a,b;
	scanf("%[^\n]*s", pt);
	tok = strtok(pt, " ");
	while (tok!=NULL) {
		if (*tok == '+') {
			a = pop(--top, result);
			b = pop(--top, result);
			push(a + b, top++, result);
		}

		else if (*tok == '-') {
			b = pop(--top, result);
			a = pop(--top, result);
			push(a - b, top++, result);
		}
		
		else if (*tok == '*') {
			a = pop(--top, result);
			b = pop(--top, result);
			push(a * b, top++, result);
		}

		else {
			num = atoi(tok);
			push(num, top++, result);
		}
		tok = strtok(NULL, " ");
	}
	printf("%d\n",pop(--top,result));
	return 0;
}

void push(int n, int t, int a[]){
	if (t >= N) printf("Over flow\n"),exit(1);
	a[t] = n;
}

int pop(int t, int a[]){
	if (t < 0) printf("Under flow\n"),exit(1);
	return a[t];
}