import std.algorithm,
       std.string,
       std.array,
       std.range,
       std.stdio,
       std.conv;

void main() {
  int[] nm = readln.chomp.split.to!(int[]);
  int n = nm[0],
      m = nm[1];

  writeln((n - 1) * (m - 1));
}
