function Main(input){
	// input = inp;
	var tmp = input.split(" ");
	var n = tmp[0];
	var m = tmp[1];
	var number = (n - 1) * (m - 1);
	console.log(number);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));