import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] stack = new int[100];
		int sp = 0;
		while(scan.hasNext()){
			String str = scan.next();
			if(str.equals("+")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			}else if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			}
		}
		for(int i = 0;i < sp;i++){
			System.out.println(stack[i]);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] stack = new int[100];
		int sp = 0;
		while(scan.hasNext()){
			String str = scan.next();
			if(str.equals("+")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			}else if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			}
		}
		for(int i = 0;i < sp;i++){
			System.out.println(stack[i]);
		}
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] stack = new int[100];
		int sp = 0;
		while(scan.hasNext()){
			String str = scan.next();
			if(str.equals("+")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			}else if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			}
		}
		for(int i = 0;i < sp;i++){
			System.out.println(stack[i]);
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int[] stack = new int[100];
		int sp = 0;
		while(scan.hasNext()){
			String str = scan.next();
			if(str.equals("+")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			}else if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			}
		}
		for(int i = 0;i < sp;i++){
			System.out.println(stack[i]);
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] stack = new int[100]; stack new int[100] 100 int sp = 0; sp 0 while(scan.hasNext()){
			String str = scan.next();
			if(str.equals("+")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			}else if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			}
		} scan.hasNext() scan.hasNext scan {
			String str = scan.next();
			if(str.equals("+")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			}else if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			}
		} String str = scan.next(); str scan.next() scan.next scan if(str.equals("+")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			}else if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			} str.equals("+") str.equals str "+" {
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			} int a = stack[--sp]; a stack[--sp] stack --sp sp int b = stack[--sp]; b stack[--sp] stack --sp sp stack[sp++] = a + b stack[sp++] stack sp++ sp a + b a b if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			} str.equals("-") str.equals str "-" {
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			} int a = stack[--sp]; a stack[--sp] stack --sp sp int b = stack[--sp]; b stack[--sp] stack --sp sp stack[sp++] = b - a stack[sp++] stack sp++ sp b - a b a if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			} str.equals("*") str.equals str "*" {
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			} int a = stack[--sp]; a stack[--sp] stack --sp sp int b = stack[--sp]; b stack[--sp] stack --sp sp stack[sp++] = a * b stack[sp++] stack sp++ sp a * b a b {
				stack[sp++] = Integer.parseInt(str);
			} stack[sp++] = Integer.parseInt(str) stack[sp++] stack sp++ sp Integer.parseInt(str) Integer.parseInt Integer str for(int i = 0;i < sp;i++){
			System.out.println(stack[i]);
		} int i = 0; int i = 0; i 0 i < sp i sp i++ i++ i {
			System.out.println(stack[i]);
		} {
			System.out.println(stack[i]);
		} System.out.println(stack[i]) System.out.println System.out System System.out stack[i] stack i String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] stack = new int[100];
		int sp = 0;
		while(scan.hasNext()){
			String str = scan.next();
			if(str.equals("+")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			}else if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			}
		}
		for(int i = 0;i < sp;i++){
			System.out.println(stack[i]);
		}
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] stack = new int[100];
		int sp = 0;
		while(scan.hasNext()){
			String str = scan.next();
			if(str.equals("+")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			}else if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			}
		}
		for(int i = 0;i < sp;i++){
			System.out.println(stack[i]);
		}
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] stack = new int[100];
		int sp = 0;
		while(scan.hasNext()){
			String str = scan.next();
			if(str.equals("+")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a + b;
			}else if(str.equals("-")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = b - a;
			}else if(str.equals("*")){
				int a = stack[--sp];
				int b = stack[--sp];
				stack[sp++] = a * b;
			}else{
				stack[sp++] = Integer.parseInt(str);
			}
		}
		for(int i = 0;i < sp;i++){
			System.out.println(stack[i]);
		}
	}
}