
import java.util.*;


public class Main {
	public static void main(String[] args) {	 
	        int number1;
	        int number2;
	        int answer;
	        Scanner in = new Scanner(System.in);
	        Stack<Integer> stack = new Stack<Integer>();
	        String operator = in.nextLine();
	        String[] arr = operator.split(" ");
	        
	        for(String t : arr){
	           
	                switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                }
	            }
	        answer = stack.pop();
	        System.out.println(answer);
	    }
}
 import java.util.*; util.* java public class Main {
	public static void main(String[] args) {	 
	        int number1;
	        int number2;
	        int answer;
	        Scanner in = new Scanner(System.in);
	        Stack<Integer> stack = new Stack<Integer>();
	        String operator = in.nextLine();
	        String[] arr = operator.split(" ");
	        
	        for(String t : arr){
	           
	                switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                }
	            }
	        answer = stack.pop();
	        System.out.println(answer);
	    }
} Main public static void main(String[] args) {	 
	        int number1;
	        int number2;
	        int answer;
	        Scanner in = new Scanner(System.in);
	        Stack<Integer> stack = new Stack<Integer>();
	        String operator = in.nextLine();
	        String[] arr = operator.split(" ");
	        
	        for(String t : arr){
	           
	                switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                }
	            }
	        answer = stack.pop();
	        System.out.println(answer);
	    } main {	 
	        int number1;
	        int number2;
	        int answer;
	        Scanner in = new Scanner(System.in);
	        Stack<Integer> stack = new Stack<Integer>();
	        String operator = in.nextLine();
	        String[] arr = operator.split(" ");
	        
	        for(String t : arr){
	           
	                switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                }
	            }
	        answer = stack.pop();
	        System.out.println(answer);
	    } int number1; number1 int number2; number2 int answer; answer Scanner in = new Scanner(System.in); in new Scanner(System.in) Stack<Integer> stack = new Stack<Integer>(); stack new Stack<Integer>() String operator = in.nextLine(); operator in.nextLine() in.nextLine in String[] arr = operator.split(" "); arr operator.split(" ") operator.split operator " " for(String t : arr){
	           
	                switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                }
	            } String t arr {
	           
	                switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                }
	            } {
	           
	                switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                }
	            } switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                } t case "+": "+" case "+": number1 = stack.pop() number1 stack.pop() stack.pop stack number2 = stack.pop() number2 stack.pop() stack.pop stack stack.push(number2 + number1) stack.push stack number2 + number1 number2 number1 break; case "-": "-" case "-": number1 = stack.pop() number1 stack.pop() stack.pop stack number2 = stack.pop() number2 stack.pop() stack.pop stack stack.push(number2 - number1) stack.push stack number2 - number1 number2 number1 break; case "*": "*" case "*": number1 = stack.pop() number1 stack.pop() stack.pop stack number2 = stack.pop() number2 stack.pop() stack.pop stack stack.push(number2 * number1) stack.push stack number2 * number1 number2 number1 break; case "/": "/" case "/": number1 = stack.pop() number1 stack.pop() stack.pop stack number2 = stack.pop() number2 stack.pop() stack.pop stack stack.push(number2 / number1) stack.push stack number2 / number1 number2 number1 break; default: default: stack.push(Integer.parseInt(t)) stack.push stack Integer.parseInt(t) Integer.parseInt Integer t break; answer = stack.pop() answer stack.pop() stack.pop stack System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
	public static void main(String[] args) {	 
	        int number1;
	        int number2;
	        int answer;
	        Scanner in = new Scanner(System.in);
	        Stack<Integer> stack = new Stack<Integer>();
	        String operator = in.nextLine();
	        String[] arr = operator.split(" ");
	        
	        for(String t : arr){
	           
	                switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                }
	            }
	        answer = stack.pop();
	        System.out.println(answer);
	    }
} public class Main {
	public static void main(String[] args) {	 
	        int number1;
	        int number2;
	        int answer;
	        Scanner in = new Scanner(System.in);
	        Stack<Integer> stack = new Stack<Integer>();
	        String operator = in.nextLine();
	        String[] arr = operator.split(" ");
	        
	        for(String t : arr){
	           
	                switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                }
	            }
	        answer = stack.pop();
	        System.out.println(answer);
	    }
} Main

import java.util.*;


public class Main {
	public static void main(String[] args) {	 
	        int number1;
	        int number2;
	        int answer;
	        Scanner in = new Scanner(System.in);
	        Stack<Integer> stack = new Stack<Integer>();
	        String operator = in.nextLine();
	        String[] arr = operator.split(" ");
	        
	        for(String t : arr){
	           
	                switch(t){
	                    case "+":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 + number1);
	                        break;
	                    case "-":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 - number1);
	                        break;
	                    case "*":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 * number1);
	                        break;
	                    case "/":
	                    	number1 = stack.pop();
	                    	number2 = stack.pop();
	                        stack.push(number2 / number1);
	                        break;
	                       
	                    default:
	                    	stack.push(Integer.parseInt(t));
	                    	break;
	                }
	            }
	        answer = stack.pop();
	        System.out.println(answer);
	    }
}

