a,b = map(int,input().strip().split()) if a > 1 and b > 1: if a >= b: ans = b - 1 ans = ans + b*(a-1) else: ans = a-1 ans = ans + a*(b-1) print(ans) elif a == 1 and b == 1: print(0) elif a == 1: ans = (b-1) print(ans) elif b == 1: ans = (a-1) print(ans)