import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long n=scan.nextInt(); long m=scan.nextInt(); long min=0; long max=0; if(n>m){min=m;max=n;} else {min=n;max=m;}; long cut=0; cut=(min-1)+(min)*(max-1); System.out.println(cut); } }