let x, y, d, z = Scanf.scanf " %d %d" @@ fun a b -> a, b, abs b - abs a, ref a
let c = if d < 0 then (z := -(abs x + d); if x < 0 then -d else -d + 1) else if d > 0 then (z := abs x + d; if x < 0 then d + 1 else d) else 0
let _ = Printf.printf "%d\n" @@ if !z = y then c else c + 1