/** * Created by nishant on 10/18/2016. */ import java.util.*; public class Solution { public static void main(String [] args){ Scanner sc = new Scanner(System.in); long a = sc.nextLong(); long b = sc.nextLong(); long x = Math.min(a,b); long y = Math.max(a,b); System.out.print((x-1)+ x*(y-1) ); } }