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 in = new Scanner(System.in); long n = in.nextInt(); long m = in.nextInt(); long count = 0; long temp = Math.min(n,m); long temp2; count = temp - 1; temp2 = Math.max(n,m); count += (temp2 - 1) * temp; System.out.println(count); } }