module Main where

import Control.Applicative
import Data.List

inf = 10 ^ 9 :: Int

solve :: Int -> Int -> Int
solve x y = minimum [ if y >= x then y - x else inf
                    , if (-x - y) >= 0 then (-x - y) + 1 else inf
                    , if y + x >= 0 then y + x + 1 else inf
                    , if x - y >= 0 then x - y + 2 else inf
                    ]

main :: IO ()
main = do
  [x, y] <- map read . words <$> getLine
  print $ solve x y
