def solve(): x, y = map(int, input().split()) if x == y: return 0 if y == 0: return 1 if x == 0: return 2 if x == -y: return 3 return -1 print(solve())