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