main = do
  [x,y] <- map read . words <$> getLine
  print (scalc x y)
 
scalc x y
 | x <= y = d + sign1
 | otherwise = d + 1 + sign2
  where
    d = abs (abs x - abs y)
    sign1 = if signum x == negate (signum y) then 1 else 0
    sign2 = if signum x == negate (signum y) then 0 else 1