X, Y = map(int, input().split()) if X == Y: print(0) elif Y == 0: print(1) elif X == 0: print(2) elif X == -Y: print(3) else: print(-1)