m, n = [int(x) for x in input().split()] bigger = max(m, n) smaller = min(m, n) if smaller == 1: if bigger == 1: print(0) else: print(bigger-1) else: print((smaller-1)+(smaller)*(bigger-1))