main = do [x,y] <- map read . words <$> getLine let ans = case (x,y) of _ | x == y -> 0 _ | x + y == 0 -> 3 (0,_) -> 2 (_,0) -> 1 _ -> -1 print ans