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

class Main {

  public static int popAsInt(Stack<String> stack) {
    return Integer.parseInt(stack.pop());
  }

  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    String opsStr = s.nextLine();
    String[] ops = opsStr.split(" ");
    Stack<String> stack = new Stack<String>();
    for (String op : ops) {
      switch(op) {
        case "+":
          stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));
          break;
        case "-":
          int second = popAsInt(stack);
          int first = popAsInt(stack);
          stack.push(Integer.toString(first - second));
          break;
        case "*":
          stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));
          break;
        default:
          stack.push(op);
          break;
      }
    }
    System.out.println(stack.pop());
  }

}
 import java.util.Scanner; Scanner java.util import java.util.Stack; Stack java.util class Main {

  public static int popAsInt(Stack<String> stack) {
    return Integer.parseInt(stack.pop());
  }

  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    String opsStr = s.nextLine();
    String[] ops = opsStr.split(" ");
    Stack<String> stack = new Stack<String>();
    for (String op : ops) {
      switch(op) {
        case "+":
          stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));
          break;
        case "-":
          int second = popAsInt(stack);
          int first = popAsInt(stack);
          stack.push(Integer.toString(first - second));
          break;
        case "*":
          stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));
          break;
        default:
          stack.push(op);
          break;
      }
    }
    System.out.println(stack.pop());
  }

} Main public static int popAsInt(Stack<String> stack) {
    return Integer.parseInt(stack.pop());
  } popAsInt {
    return Integer.parseInt(stack.pop());
  } return Integer.parseInt(stack.pop()); Integer.parseInt(stack.pop()) Integer.parseInt Integer stack.pop() stack.pop stack Stack<String> stack stack public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    String opsStr = s.nextLine();
    String[] ops = opsStr.split(" ");
    Stack<String> stack = new Stack<String>();
    for (String op : ops) {
      switch(op) {
        case "+":
          stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));
          break;
        case "-":
          int second = popAsInt(stack);
          int first = popAsInt(stack);
          stack.push(Integer.toString(first - second));
          break;
        case "*":
          stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));
          break;
        default:
          stack.push(op);
          break;
      }
    }
    System.out.println(stack.pop());
  } main {
    Scanner s = new Scanner(System.in);
    String opsStr = s.nextLine();
    String[] ops = opsStr.split(" ");
    Stack<String> stack = new Stack<String>();
    for (String op : ops) {
      switch(op) {
        case "+":
          stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));
          break;
        case "-":
          int second = popAsInt(stack);
          int first = popAsInt(stack);
          stack.push(Integer.toString(first - second));
          break;
        case "*":
          stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));
          break;
        default:
          stack.push(op);
          break;
      }
    }
    System.out.println(stack.pop());
  } Scanner s = new Scanner(System.in); s new Scanner(System.in) String opsStr = s.nextLine(); opsStr s.nextLine() s.nextLine s String[] ops = opsStr.split(" "); ops opsStr.split(" ") opsStr.split opsStr " " Stack<String> stack = new Stack<String>(); stack new Stack<String>() for (String op : ops) {
      switch(op) {
        case "+":
          stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));
          break;
        case "-":
          int second = popAsInt(stack);
          int first = popAsInt(stack);
          stack.push(Integer.toString(first - second));
          break;
        case "*":
          stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));
          break;
        default:
          stack.push(op);
          break;
      }
    } String op ops {
      switch(op) {
        case "+":
          stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));
          break;
        case "-":
          int second = popAsInt(stack);
          int first = popAsInt(stack);
          stack.push(Integer.toString(first - second));
          break;
        case "*":
          stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));
          break;
        default:
          stack.push(op);
          break;
      }
    } {
      switch(op) {
        case "+":
          stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));
          break;
        case "-":
          int second = popAsInt(stack);
          int first = popAsInt(stack);
          stack.push(Integer.toString(first - second));
          break;
        case "*":
          stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));
          break;
        default:
          stack.push(op);
          break;
      }
    } switch(op) {
        case "+":
          stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));
          break;
        case "-":
          int second = popAsInt(stack);
          int first = popAsInt(stack);
          stack.push(Integer.toString(first - second));
          break;
        case "*":
          stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));
          break;
        default:
          stack.push(op);
          break;
      } op case "+": "+" case "+": stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack))) stack.push stack Integer.toString(popAsInt(stack) + popAsInt(stack)) Integer.toString Integer popAsInt(stack) + popAsInt(stack) popAsInt(stack) popAsInt stack popAsInt(stack) popAsInt stack break; case "-": "-" case "-": int second = popAsInt(stack); second popAsInt(stack) popAsInt stack int first = popAsInt(stack); first popAsInt(stack) popAsInt stack stack.push(Integer.toString(first - second)) stack.push stack Integer.toString(first - second) Integer.toString Integer first - second first second break; case "*": "*" case "*": stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack))) stack.push stack Integer.toString(popAsInt(stack) * popAsInt(stack)) Integer.toString Integer popAsInt(stack) * popAsInt(stack) popAsInt(stack) popAsInt stack popAsInt(stack) popAsInt stack break; default: default: stack.push(op) stack.push stack op break; System.out.println(stack.pop()) System.out.println System.out System System.out stack.pop() stack.pop stack String[] args args
import java.util.Scanner;
import java.util.Stack;

class Main {

  public static int popAsInt(Stack<String> stack) {
    return Integer.parseInt(stack.pop());
  }

  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    String opsStr = s.nextLine();
    String[] ops = opsStr.split(" ");
    Stack<String> stack = new Stack<String>();
    for (String op : ops) {
      switch(op) {
        case "+":
          stack.push(Integer.toString(popAsInt(stack) + popAsInt(stack)));
          break;
        case "-":
          int second = popAsInt(stack);
          int first = popAsInt(stack);
          stack.push(Integer.toString(first - second));
          break;
        case "*":
          stack.push(Integer.toString(popAsInt(stack) * popAsInt(stack)));
          break;
        default:
          stack.push(op);
          break;
      }
    }
    System.out.println(stack.pop());
  }

}

