"use strict";

const main = arg => {
    const n = arg.split("\n")[0].split(" ")[0];
    const m = arg.split("\n")[0].split(" ")[1];
    
    console.log((n - 1) * (m - 1));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));