import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Stack {

    int top, tmp;
    int[] data;

    public Stack() {
        top = -1;
        data = new int[1000];
        tmp = 0;
    }

    public int pop() {
        tmp = data[top];
        data[top--] = 0;
        return tmp;
    }

    public void push(int a) {
        data[++top] = a;
    }
}

class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Stack s = new Stack();
        int a, b;
        try {
            String[] n;
            n = br.readLine().split(" ");
            for (int i = 0; i < n.length; i++) {
                if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                }
            }
            System.out.println(s.pop());
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Stack {

    int top, tmp;
    int[] data;

    public Stack() {
        top = -1;
        data = new int[1000];
        tmp = 0;
    }

    public int pop() {
        tmp = data[top];
        data[top--] = 0;
        return tmp;
    }

    public void push(int a) {
        data[++top] = a;
    }
} Stack int top top tmp; tmp int[] data; data public Stack() {
        top = -1;
        data = new int[1000];
        tmp = 0;
    } Stack {
        top = -1;
        data = new int[1000];
        tmp = 0;
    } top = -1 top -1 1 data = new int[1000] data new int[1000] 1000 tmp = 0 tmp 0 public int pop() {
        tmp = data[top];
        data[top--] = 0;
        return tmp;
    } pop {
        tmp = data[top];
        data[top--] = 0;
        return tmp;
    } tmp = data[top] tmp data[top] data top data[top--] = 0 data[top--] data top-- top 0 return tmp; tmp public void push(int a) {
        data[++top] = a;
    } push {
        data[++top] = a;
    } data[++top] = a data[++top] data ++top top a int a a class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Stack s = new Stack();
        int a, b;
        try {
            String[] n;
            n = br.readLine().split(" ");
            for (int i = 0; i < n.length; i++) {
                if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                }
            }
            System.out.println(s.pop());
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
} Main public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Stack s = new Stack();
        int a, b;
        try {
            String[] n;
            n = br.readLine().split(" ");
            for (int i = 0; i < n.length; i++) {
                if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                }
            }
            System.out.println(s.pop());
        } catch (IOException e) {
            e.printStackTrace();
        }

    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Stack s = new Stack();
        int a, b;
        try {
            String[] n;
            n = br.readLine().split(" ");
            for (int i = 0; i < n.length; i++) {
                if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                }
            }
            System.out.println(s.pop());
        } catch (IOException e) {
            e.printStackTrace();
        }

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) Stack s = new Stack(); s new Stack() int a a b; b try {
            String[] n;
            n = br.readLine().split(" ");
            for (int i = 0; i < n.length; i++) {
                if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                }
            }
            System.out.println(s.pop());
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            String[] n;
            n = br.readLine().split(" ");
            for (int i = 0; i < n.length; i++) {
                if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                }
            }
            System.out.println(s.pop());
        } String[] n; n n = br.readLine().split(" ") n br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int i = 0; i < n.length; i++) {
                if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                }
            } int i = 0; int i = 0; i 0 i < n.length i n.length n n.length i++ i++ i {
                if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                }
            } {
                if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                }
            } if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                } n[i].equals("+") n[i].equals n[i] n i "+" {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } a = s.pop() a s.pop() s.pop s b = s.pop() b s.pop() s.pop s s.push(a + b) s.push s a + b a b if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                } n[i].equals("-") n[i].equals n[i] n i "-" {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } a = s.pop() a s.pop() s.pop s b = s.pop() b s.pop() s.pop s s.push(b - a) s.push s b - a b a if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                } n[i].equals("/") n[i].equals n[i] n i "/" {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } a = s.pop() a s.pop() s.pop s b = s.pop() b s.pop() s.pop s s.push(b / a) s.push s b / a b a if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                } n[i].equals("*") n[i].equals n[i] n i "*" {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } a = s.pop() a s.pop() s.pop s b = s.pop() b s.pop() s.pop s s.push(a * b) s.push s a * b a b {
                    s.push(Integer.parseInt(n[i]));
                } s.push(Integer.parseInt(n[i])) s.push s Integer.parseInt(n[i]) Integer.parseInt Integer n[i] n i System.out.println(s.pop()) System.out.println System.out System System.out s.pop() s.pop s String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Stack {

    int top, tmp;
    int[] data;

    public Stack() {
        top = -1;
        data = new int[1000];
        tmp = 0;
    }

    public int pop() {
        tmp = data[top];
        data[top--] = 0;
        return tmp;
    }

    public void push(int a) {
        data[++top] = a;
    }
}

class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Stack s = new Stack();
        int a, b;
        try {
            String[] n;
            n = br.readLine().split(" ");
            for (int i = 0; i < n.length; i++) {
                if (n[i].equals("+")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a + b);
                } else if (n[i].equals("-")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b - a);
                } else if (n[i].equals("/")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(b / a);
                } else if (n[i].equals("*")) {
                    a = s.pop();
                    b = s.pop();
                    s.push(a * b);
                } else {
                    s.push(Integer.parseInt(n[i]));
                }
            }
            System.out.println(s.pop());
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
