print((function (x, y) if x==y then return 0 end if y==0 then return 1 end if x==0 then return 2 end if x==-y then return 3 end return -1 end)(io.stdin:read("*n"), io.stdin:read("*n")))