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) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner sc = new Scanner(System.in); long n = sc.nextInt(); long m = sc.nextInt(); long cuts = 0 ; if(n>m){ cuts += m-1; cuts += (cuts+1 ) * (n-1); } else if(m>n){ cuts += n-1; cuts += (cuts+1) * (m-1); } else if(m==n){ cuts += m-1; cuts += (cuts+1)*(n-1); } System.out.println(cuts); } }