import java.util.Scanner;
import java.util.Stack;

public class Main {
   public static Scanner sc=new Scanner(System.in);
  
       public static void main(String[] args) {
           String s;
           s=sc.nextLine();
           String a[]=s.split(" ");
           Stack<Integer> st=new Stack<>();
           for(int i=0;i<a.length;i++) {
               boolean numeric = true;
                try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                }
               if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               }
           }
          
           System.out.println(st.pop());
          
       }
} import java.util.Scanner; Scanner java.util import java.util.Stack; Stack java.util public class Main {
   public static Scanner sc=new Scanner(System.in);
  
       public static void main(String[] args) {
           String s;
           s=sc.nextLine();
           String a[]=s.split(" ");
           Stack<Integer> st=new Stack<>();
           for(int i=0;i<a.length;i++) {
               boolean numeric = true;
                try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                }
               if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               }
           }
          
           System.out.println(st.pop());
          
       }
} Main public static Scanner sc=new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
           String s;
           s=sc.nextLine();
           String a[]=s.split(" ");
           Stack<Integer> st=new Stack<>();
           for(int i=0;i<a.length;i++) {
               boolean numeric = true;
                try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                }
               if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               }
           }
          
           System.out.println(st.pop());
          
       } main {
           String s;
           s=sc.nextLine();
           String a[]=s.split(" ");
           Stack<Integer> st=new Stack<>();
           for(int i=0;i<a.length;i++) {
               boolean numeric = true;
                try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                }
               if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               }
           }
          
           System.out.println(st.pop());
          
       } String s; s s=sc.nextLine() s sc.nextLine() sc.nextLine sc String a[]=s.split(" "); a s.split(" ") s.split s " " Stack<Integer> st=new Stack<>(); st new Stack<>() for(int i=0;i<a.length;i++) {
               boolean numeric = true;
                try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                }
               if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               }
           } int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
               boolean numeric = true;
                try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                }
               if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               }
           } {
               boolean numeric = true;
                try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                }
               if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               }
           } boolean numeric = true; numeric true try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                } catch (NumberFormatException e) {
                    numeric = false;
                } NumberFormatException e {
                    numeric = false;
                } numeric = false numeric false {
                    int num = Integer.parseInt(a[i]);
                } int num = Integer.parseInt(a[i]); num Integer.parseInt(a[i]) Integer.parseInt Integer a[i] a i if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               } numeric {
                   st.push(Integer.parseInt(a[i]));
               } st.push(Integer.parseInt(a[i])) st.push st Integer.parseInt(a[i]) Integer.parseInt Integer a[i] a i {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               } int val1=st.pop(); val1 st.pop() st.pop st int val2=st.pop(); val2 st.pop() st.pop st switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   } a[i] a i case "+": "+" case "+": st.push(val2+val1) st.push st val2+val1 val2 val1 break; case "-": "-" case "-": st.push(val2-val1) st.push st val2-val1 val2 val1 break; case "*": "*" case "*": st.push(val2*val1) st.push st val2*val1 val2 val1 break; case "/": "/" case "/": st.push(val2/val1) st.push st val2/val1 val2 val1 break; System.out.println(st.pop()) System.out.println System.out System System.out st.pop() st.pop st String[] args args public class Main {
   public static Scanner sc=new Scanner(System.in);
  
       public static void main(String[] args) {
           String s;
           s=sc.nextLine();
           String a[]=s.split(" ");
           Stack<Integer> st=new Stack<>();
           for(int i=0;i<a.length;i++) {
               boolean numeric = true;
                try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                }
               if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               }
           }
          
           System.out.println(st.pop());
          
       }
} public class Main {
   public static Scanner sc=new Scanner(System.in);
  
       public static void main(String[] args) {
           String s;
           s=sc.nextLine();
           String a[]=s.split(" ");
           Stack<Integer> st=new Stack<>();
           for(int i=0;i<a.length;i++) {
               boolean numeric = true;
                try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                }
               if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               }
           }
          
           System.out.println(st.pop());
          
       }
} Main
import java.util.Scanner;
import java.util.Stack;

public class Main {
   public static Scanner sc=new Scanner(System.in);
  
       public static void main(String[] args) {
           String s;
           s=sc.nextLine();
           String a[]=s.split(" ");
           Stack<Integer> st=new Stack<>();
           for(int i=0;i<a.length;i++) {
               boolean numeric = true;
                try {
                    int num = Integer.parseInt(a[i]);
                } catch (NumberFormatException e) {
                    numeric = false;
                }
               if(numeric) {
                   st.push(Integer.parseInt(a[i]));
               }else {
                   int val1=st.pop();
                   int val2=st.pop();
                   switch(a[i]) {
                   case "+":
                       st.push(val2+val1);
                       break;
                   case "-":
                       st.push(val2-val1);
                       break;
                   case "*":
                       st.push(val2*val1);
                       break;
                   case "/":
                       st.push(val2/val1);
                       break;
                   }
               }
           }
          
           System.out.println(st.pop());
          
       }
}
