Scanf.scanf "%d %d %d" (fun a b c ->
    let arr = [| a; b; c |] in
    Array.sort compare arr;
    let a, b, c = arr.(0), arr.(1), arr.(2) in

    let ac = c - a in
    let bc = c - b in

    Printf.printf "%d\n" @@ (ac + bc + ((ac + bc) mod 2) * 3) / 2
)