import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); long m = in.nextLong(); long n = in.nextLong(); long larger = (m>=n) ? m : n; long smaller = (m>=n) ? n :m; System.out.println((smaller-1) + (smaller*(larger-1))); } }