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