let () =
  Scanf.scanf "%d %d" (fun x y ->
    [ if x <= y then y - x else max_int;
      if -x <= y then 1 + x + y else max_int;
      if x <= -y then 1 - x - y else max_int;
      if -x <= -y then 2 + x - y else max_int ])
  |> List.fold_left min max_int
  |> Printf.printf "%d\n"

