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 scanner = new Scanner(System.in); Long n = scanner.nextLong(); Long m = scanner.nextLong(); Long count = 0L; if(n == 1) { count = m -1; } else if (m == 1) { count = n -1; } else { count =((n-1) * m) +m-1; } System.out.println(count); scanner.close(); } }