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); int n = in.nextInt(); int m = in.nextInt(); long max = m; long min = n; if(m < n){ max = n; min = m; } long result = (min - 1) + ((max - 1)*min); // if(result == 0){ // result = max - 1; // } System.out.println(result); } }