function main(input) {
  const a = parseInt(input.split(" ")[0], 10);
  const b = parseInt(input.split(" ")[1], 10);
  console.log((a-1)*(b-1));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));