let rec calc x y =
  if x <= y then
    if x * y <= 0 then min (y-x) (y+x+1) else y-x
  else if x * y >= 0 then 2 + (x-y)
  else 1 + abs (x+y)

let _ = Scanf.scanf "%d %d" @@ calc |> Printf.printf "%d\n"