import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner inp = new Scanner(System.in);

        int[] numbers = new int[100];
        int numberPlace = 0;
        String s;

        while(inp.hasNext()){
            s = inp.next();
            if (s.equals("=")){
                break;
            }
            if (s.equals("+")){
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            }

            numberPlace++;
        }

        System.out.println(numbers[numberPlace-1]);
    }
}
 import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner inp = new Scanner(System.in);

        int[] numbers = new int[100];
        int numberPlace = 0;
        String s;

        while(inp.hasNext()){
            s = inp.next();
            if (s.equals("=")){
                break;
            }
            if (s.equals("+")){
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            }

            numberPlace++;
        }

        System.out.println(numbers[numberPlace-1]);
    }
} Main public static void main(String[] args) {
        Scanner inp = new Scanner(System.in);

        int[] numbers = new int[100];
        int numberPlace = 0;
        String s;

        while(inp.hasNext()){
            s = inp.next();
            if (s.equals("=")){
                break;
            }
            if (s.equals("+")){
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            }

            numberPlace++;
        }

        System.out.println(numbers[numberPlace-1]);
    } main {
        Scanner inp = new Scanner(System.in);

        int[] numbers = new int[100];
        int numberPlace = 0;
        String s;

        while(inp.hasNext()){
            s = inp.next();
            if (s.equals("=")){
                break;
            }
            if (s.equals("+")){
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            }

            numberPlace++;
        }

        System.out.println(numbers[numberPlace-1]);
    } Scanner inp = new Scanner(System.in); inp new Scanner(System.in) int[] numbers = new int[100]; numbers new int[100] 100 int numberPlace = 0; numberPlace 0 String s; s while(inp.hasNext()){
            s = inp.next();
            if (s.equals("=")){
                break;
            }
            if (s.equals("+")){
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            }

            numberPlace++;
        } inp.hasNext() inp.hasNext inp {
            s = inp.next();
            if (s.equals("=")){
                break;
            }
            if (s.equals("+")){
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            }

            numberPlace++;
        } s = inp.next() s inp.next() inp.next inp if (s.equals("=")){
                break;
            } s.equals("=") s.equals s "=" {
                break;
            } break; if (s.equals("+")){
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            } s.equals("+") s.equals s "+" {
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1]; tempHold numbers[numberPlace-2] + numbers[numberPlace-1] numbers[numberPlace-2] numbers numberPlace-2 numberPlace 2 numbers[numberPlace-1] numbers numberPlace-1 numberPlace 1 numbers[numberPlace-1] = 0 numbers[numberPlace-1] numbers numberPlace-1 numberPlace 1 0 numbers[numberPlace-2] = 0 numbers[numberPlace-2] numbers numberPlace-2 numberPlace 2 0 numberPlace -= 2 numberPlace 2 numbers[numberPlace] = tempHold numbers[numberPlace] numbers numberPlace tempHold if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            } s.equals("-") s.equals s "-" {
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1]; tempHold numbers[numberPlace-2] - numbers[numberPlace-1] numbers[numberPlace-2] numbers numberPlace-2 numberPlace 2 numbers[numberPlace-1] numbers numberPlace-1 numberPlace 1 numbers[numberPlace-1] = 0 numbers[numberPlace-1] numbers numberPlace-1 numberPlace 1 0 numbers[numberPlace-2] = 0 numbers[numberPlace-2] numbers numberPlace-2 numberPlace 2 0 numberPlace -= 2 numberPlace 2 numbers[numberPlace] = tempHold numbers[numberPlace] numbers numberPlace tempHold if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            } s.equals("*") s.equals s "*" {
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1]; tempHold numbers[numberPlace-2] * numbers[numberPlace-1] numbers[numberPlace-2] numbers numberPlace-2 numberPlace 2 numbers[numberPlace-1] numbers numberPlace-1 numberPlace 1 numbers[numberPlace-1] = 0 numbers[numberPlace-1] numbers numberPlace-1 numberPlace 1 0 numbers[numberPlace-2] = 0 numbers[numberPlace-2] numbers numberPlace-2 numberPlace 2 0 numberPlace -= 2 numberPlace 2 numbers[numberPlace] = tempHold numbers[numberPlace] numbers numberPlace tempHold {
                numbers[numberPlace] = Integer.parseInt(s);
            } numbers[numberPlace] = Integer.parseInt(s) numbers[numberPlace] numbers numberPlace Integer.parseInt(s) Integer.parseInt Integer s numberPlace++ numberPlace System.out.println(numbers[numberPlace-1]) System.out.println System.out System System.out numbers[numberPlace-1] numbers numberPlace-1 numberPlace 1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner inp = new Scanner(System.in);

        int[] numbers = new int[100];
        int numberPlace = 0;
        String s;

        while(inp.hasNext()){
            s = inp.next();
            if (s.equals("=")){
                break;
            }
            if (s.equals("+")){
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            }

            numberPlace++;
        }

        System.out.println(numbers[numberPlace-1]);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner inp = new Scanner(System.in);

        int[] numbers = new int[100];
        int numberPlace = 0;
        String s;

        while(inp.hasNext()){
            s = inp.next();
            if (s.equals("=")){
                break;
            }
            if (s.equals("+")){
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            }

            numberPlace++;
        }

        System.out.println(numbers[numberPlace-1]);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner inp = new Scanner(System.in);

        int[] numbers = new int[100];
        int numberPlace = 0;
        String s;

        while(inp.hasNext()){
            s = inp.next();
            if (s.equals("=")){
                break;
            }
            if (s.equals("+")){
                int tempHold = numbers[numberPlace-2] + numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("-")){
                int tempHold = numbers[numberPlace-2] - numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else if (s.equals("*")){
                int tempHold = numbers[numberPlace-2] * numbers[numberPlace-1];

                numbers[numberPlace-1] = 0;
                numbers[numberPlace-2] = 0;

                numberPlace -= 2;

                numbers[numberPlace] = tempHold;
            } else {
                numbers[numberPlace] = Integer.parseInt(s);
            }

            numberPlace++;
        }

        System.out.println(numbers[numberPlace-1]);
    }
}

