function Main(input){
    var inputs = input.split(' ');
    var A = parseInt(inputs[0],10);
    var B = parseInt(inputs[1],10);

    var garden = A * B;
    var road = 1 * A + 1 * B - 1;
    var w = garden - road;

    console.log(w);

}
Main(require('fs').readFileSync('/dev/stdin','utf8'));

