'use strict';

function Main(input) {
  const A = input.split(' ')[0];
  const B = input.split(' ')[1];

  console.log((A-1) * (B-1));

  
};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
