import java.util.*; class paper { public static void main(String args[]) { Scanner ex=new Scanner(System.in); long n=ex.nextLong(); long m=ex.nextLong(); long ans=(n-1)+n*(m-1); System.out.println(ans); } }