A, B = map(int, input().split()) ng = abs(A-B) ok = A+B-ng ans = abs(ok-ng) for i in range(2, ok+1, 2): ans = min(ans, abs((ok-i)-(ng+i))) print(ans)