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 input = new Scanner(System.in); long m = input.nextLong(); long n = input.nextLong(); long total = 0l; total = m-1; total = total + (m*(n-1)); System.out.println(total); } }