n,m = map(int,input().split()) p = min(n,m) q = max(n,m) q -=1 print(q*p + (p-1))