function Main(input) {
    input = input.split(" ");
    var m = input[0];
    var n = input[1];
    console.log(((n + 1) * (m + 1)) - (((n+1)*2)+(m+1)*2)-4)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));