const input = require('fs').readFileSync('/dev/stdin', 'utf8');

const list = input.split(' ');

const a = Number(list[0]);

const b = Number(list[1]);

const s = a * b;

const w = s - 1 * a - 1 * b + 1 * 1;

console.log(w);
