import java.util.Scanner;

public class Main {
    private static int[] stack;
    private static int top=0;
    private static void push(int num){
        stack[++top]=num;
    }
    private static int pop(){
        return stack[top--];
    }
    public static void main(String[] args) {
        stack = new int[205];
        Scanner sc = new Scanner(System.in);
        String[] ss = sc.nextLine().split(" ");
        for (String s : ss) {
            switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            }
        }
        System.out.println(pop());
    }
}
 import java.util.Scanner; Scanner java.util public class Main {
    private static int[] stack;
    private static int top=0;
    private static void push(int num){
        stack[++top]=num;
    }
    private static int pop(){
        return stack[top--];
    }
    public static void main(String[] args) {
        stack = new int[205];
        Scanner sc = new Scanner(System.in);
        String[] ss = sc.nextLine().split(" ");
        for (String s : ss) {
            switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            }
        }
        System.out.println(pop());
    }
} Main private static int[] stack; stack private static int top=0; top 0 private static void push(int num){
        stack[++top]=num;
    } push {
        stack[++top]=num;
    } stack[++top]=num stack[++top] stack ++top top num int num num private static int pop(){
        return stack[top--];
    } pop {
        return stack[top--];
    } return stack[top--]; stack[top--] stack top-- top public static void main(String[] args) {
        stack = new int[205];
        Scanner sc = new Scanner(System.in);
        String[] ss = sc.nextLine().split(" ");
        for (String s : ss) {
            switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            }
        }
        System.out.println(pop());
    } main {
        stack = new int[205];
        Scanner sc = new Scanner(System.in);
        String[] ss = sc.nextLine().split(" ");
        for (String s : ss) {
            switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            }
        }
        System.out.println(pop());
    } stack = new int[205] stack new int[205] 205 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] ss = sc.nextLine().split(" "); ss sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " for (String s : ss) {
            switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            }
        } String s ss {
            switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            }
        } {
            switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            }
        } switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            } s case "+": "+" case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                } int b = pop(); b pop() pop int a = pop(); a pop() pop push(a + b) push a + b a b break; case "-": "-" case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                } int b = pop(); b pop() pop int a = pop(); a pop() pop push(a - b) push a - b a b break; case "*": "*" case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                } int b = pop(); b pop() pop int a = pop(); a pop() pop push(a * b) push a * b a b break; default: default: push(Integer.parseInt(s)) push Integer.parseInt(s) Integer.parseInt Integer s break; System.out.println(pop()) System.out.println System.out System System.out pop() pop String[] args args public class Main {
    private static int[] stack;
    private static int top=0;
    private static void push(int num){
        stack[++top]=num;
    }
    private static int pop(){
        return stack[top--];
    }
    public static void main(String[] args) {
        stack = new int[205];
        Scanner sc = new Scanner(System.in);
        String[] ss = sc.nextLine().split(" ");
        for (String s : ss) {
            switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            }
        }
        System.out.println(pop());
    }
} public class Main {
    private static int[] stack;
    private static int top=0;
    private static void push(int num){
        stack[++top]=num;
    }
    private static int pop(){
        return stack[top--];
    }
    public static void main(String[] args) {
        stack = new int[205];
        Scanner sc = new Scanner(System.in);
        String[] ss = sc.nextLine().split(" ");
        for (String s : ss) {
            switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            }
        }
        System.out.println(pop());
    }
} Main
import java.util.Scanner;

public class Main {
    private static int[] stack;
    private static int top=0;
    private static void push(int num){
        stack[++top]=num;
    }
    private static int pop(){
        return stack[top--];
    }
    public static void main(String[] args) {
        stack = new int[205];
        Scanner sc = new Scanner(System.in);
        String[] ss = sc.nextLine().split(" ");
        for (String s : ss) {
            switch (s) {
                case "+": {
                    int b = pop();
                    int a = pop();
                    push(a + b);
                    break;
                }
                case "-": {
                    int b = pop();
                    int a = pop();
                    push(a - b);
                    break;
                }
                case "*": {
                    int b = pop();
                    int a = pop();
                    push(a * b);
                    break;
                }
                default:
                    push(Integer.parseInt(s));
                    break;
            }
        }
        System.out.println(pop());
    }
}

