# Enter your code here. Read input from STDIN. Print output to STDOUT n,m=map(int,raw_input().strip().split()) if(n>=m): x=m-1+(n-1)*m else: x=n-1+(m-1)*n print x