import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner scan=new Scanner(System.in); int m=scan.nextInt(); int n=scan.nextInt(); System.out.println((Math.max(m,n)-1)*(Math.min(m,n))+(Math.min(m,n)-1)); } }