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) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Scanner in = new Scanner(System.in); Solution s = new Solution(); long i = in.nextLong(); long j = in.nextLong(); long min = Math.min(i,j); if (min == i) { long ans = i - 1 + i * (j-1); System.out.println(ans); } else { long ans = j - 1 + j * (i-1); System.out.println(ans); } } }