with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;

procedure Solve is
   n : Integer;
   m : Integer;
begin
   Get (n);
   Get (m);
   Put_Line (Integer'Image ((n-1)*(m-1)));
end Solve;