import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); long n=sc.nextInt(); long m=sc.nextInt(); long maxNum=0; long minNum=0; if(n>m){ maxNum=n; minNum=m; } else{ maxNum=m; minNum=n; } long result1=(minNum-1)+((maxNum-1)*(minNum)); long result2=(maxNum-1)+((minNum-1)*(maxNum)); System.out.println(Math.min(result1,result2)); } }