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 m=sc.nextLong(); long n=sc.nextLong(); long count=0; if(m==1 && n!=1) { System.out.println(n-1); } else if(n==1 && m!=1) { System.out.println(m-1); } else if(m>n) { count+=n-1; count+=n*(m-1); System.out.println(count); } else if(n>m) { count+=m-1; count+=m*(n-1); System.out.println(count); } else if(m==n) { // count+=n-1; //count+=n*(m-1); System.out.println((m-1)*(n+1)); } } }