import java.util.Scanner;

public class Main {
	static int top = 1;
	static int[] stack = new int[200];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			if (sc.hasNextInt()) {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} else {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			}
		}
		System.out.println(push());

	}

	static void pop(int x) {
		if (top == stack.length - 1) {
			System.err.println("スタックが満杯です");
			return;
		}
		stack[top] = x;
		top++;
	}

	static int push() {
		if (top == 0) {
			System.err.println("スタックが空っぽです");
			return -1;
		}
		top--;
		int ret = stack[top];
		return ret;
	}

}
 import java.util.Scanner; Scanner java.util public class Main {
	static int top = 1;
	static int[] stack = new int[200];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			if (sc.hasNextInt()) {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} else {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			}
		}
		System.out.println(push());

	}

	static void pop(int x) {
		if (top == stack.length - 1) {
			System.err.println("スタックが満杯です");
			return;
		}
		stack[top] = x;
		top++;
	}

	static int push() {
		if (top == 0) {
			System.err.println("スタックが空っぽです");
			return -1;
		}
		top--;
		int ret = stack[top];
		return ret;
	}

} Main static int top = 1; top 1 static int[] stack = new int[200]; stack new int[200] 200 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			if (sc.hasNextInt()) {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} else {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			}
		}
		System.out.println(push());

	} main {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			if (sc.hasNextInt()) {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} else {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			}
		}
		System.out.println(push());

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (sc.hasNext()) {
			if (sc.hasNextInt()) {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} else {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			}
		} sc.hasNext() sc.hasNext sc {
			if (sc.hasNextInt()) {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} else {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			}
		} if (sc.hasNextInt()) {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} else {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			} sc.hasNextInt() sc.hasNextInt sc {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} int tmpNum = sc.nextInt(); tmpNum sc.nextInt() sc.nextInt sc pop(tmpNum) pop tmpNum {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			} String opr = sc.next(); opr sc.next() sc.next sc int a = push(); a push() push int b = push(); b push() push switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				} opr case "+": "+" case "+": pop(b + a) pop b + a b a break; case "-": "-" case "-": pop(b - a) pop b - a b a break; case "*": "*" case "*": pop(b * a) pop b * a b a break; System.out.println(push()) System.out.println System.out System System.out push() push String[] args args static void pop(int x) {
		if (top == stack.length - 1) {
			System.err.println("スタックが満杯です");
			return;
		}
		stack[top] = x;
		top++;
	} pop {
		if (top == stack.length - 1) {
			System.err.println("スタックが満杯です");
			return;
		}
		stack[top] = x;
		top++;
	} if (top == stack.length - 1) {
			System.err.println("スタックが満杯です");
			return;
		} top == stack.length - 1 top stack.length - 1 stack.length stack stack.length 1 {
			System.err.println("スタックが満杯です");
			return;
		} System.err.println("スタックが満杯です") System.err.println System.err System System.err "スタックが満杯です" return; stack[top] = x stack[top] stack top x top++ top int x x static int push() {
		if (top == 0) {
			System.err.println("スタックが空っぽです");
			return -1;
		}
		top--;
		int ret = stack[top];
		return ret;
	} push {
		if (top == 0) {
			System.err.println("スタックが空っぽです");
			return -1;
		}
		top--;
		int ret = stack[top];
		return ret;
	} if (top == 0) {
			System.err.println("スタックが空っぽです");
			return -1;
		} top == 0 top 0 {
			System.err.println("スタックが空っぽです");
			return -1;
		} System.err.println("スタックが空っぽです") System.err.println System.err System System.err "スタックが空っぽです" return -1; -1 1 top-- top int ret = stack[top]; ret stack[top] stack top return ret; ret public class Main {
	static int top = 1;
	static int[] stack = new int[200];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			if (sc.hasNextInt()) {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} else {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			}
		}
		System.out.println(push());

	}

	static void pop(int x) {
		if (top == stack.length - 1) {
			System.err.println("スタックが満杯です");
			return;
		}
		stack[top] = x;
		top++;
	}

	static int push() {
		if (top == 0) {
			System.err.println("スタックが空っぽです");
			return -1;
		}
		top--;
		int ret = stack[top];
		return ret;
	}

} public class Main {
	static int top = 1;
	static int[] stack = new int[200];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			if (sc.hasNextInt()) {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} else {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			}
		}
		System.out.println(push());

	}

	static void pop(int x) {
		if (top == stack.length - 1) {
			System.err.println("スタックが満杯です");
			return;
		}
		stack[top] = x;
		top++;
	}

	static int push() {
		if (top == 0) {
			System.err.println("スタックが空っぽです");
			return -1;
		}
		top--;
		int ret = stack[top];
		return ret;
	}

} Main
import java.util.Scanner;

public class Main {
	static int top = 1;
	static int[] stack = new int[200];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			if (sc.hasNextInt()) {
				int tmpNum = sc.nextInt();
				pop(tmpNum);

			} else {
				String opr = sc.next();
				int a = push();
				int b = push();

				switch (opr) {
				case "+":
					pop(b + a);
					break;
				case "-":
					pop(b - a);
					break;
				case "*":
					pop(b * a);
					break;

				}

			}
		}
		System.out.println(push());

	}

	static void pop(int x) {
		if (top == stack.length - 1) {
			System.err.println("スタックが満杯です");
			return;
		}
		stack[top] = x;
		top++;
	}

	static int push() {
		if (top == 0) {
			System.err.println("スタックが空っぽです");
			return -1;
		}
		top--;
		int ret = stack[top];
		return ret;
	}

}

