function main(input){
    var tmp = [];
    tmp = input.split(" ");
    var n = Number(tmp[0]);
    var m = Number(tmp[1]);
    var res = (n-1)*(m-1);

    console.log(res);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));