#yuki643 x,y=map(int,raw_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