a, b = map(int, input().split()) ma = a + b mi = abs(a - b) - 2 * min(a, b) if mi < 0: print(ma % 2) else: print(mi)