function Main(input){ 
var inputs =input.split(" ");
var A = parseInt(inputs[0],10);
var B = parseInt(inputs[1],10);
var answer = (A-1)*(B-1);
console.log(answer);

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