import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * Created by Rose on 10/18/2016. */ public class CuttingPaperSquares { public static void main(String args[]) throws IOException { long n, k, m, f = 0; long bCharged, bActual; long sum = 0; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String input[] = br.readLine().split(" "); n = Long.parseLong((input[0])); m = Long.parseLong((input[1])); sum+=(m*(n-1)); sum+=(m-1); System.out.println(sum); } }