def solve(): X, Y = map(int, input().split()) if Y == 0: print(1) return elif X == 0: print(2) return elif X == Y: print(0) return elif X == -Y: print(3) return else: print(-1) if __name__ == "__main__": solve()