public static int eval(String s) {
        LinkedList<Integer> eval_stack = new LinkedList<Integer>();
        String[] symbols = s.split(",");
        for(String symbol : symbols) {
            if (symbol.length() == 1 && "+-*/".contains(symbol)) {
                int y = eval_stack.pop();
                int x = eval_stack.pop();
                switch (symbol.charAt(0)) {
                    case '+':
                        eval_stack.push(x + y);
                        break;
                    case '-':
                        eval_stack.push(x - y);
                        break;
                    case '*':
                        eval_stack.push(x * y);
                        break;
                    case '/':
                        eval_stack.push(x / y);
                        break;
                }
            } else {  // number.
                eval_stack.push(Integer.parseInt(symbol));
            }
        }
        return eval_stack.pop();
    }