let split_string ?(pattern="") = Str.split @@ Str.regexp pattern
let a, b, c = 
  match read_line () |> split_string ~pattern:" " |> List.map int_of_string |> List.sort compare with
    | a :: b :: c :: [] -> (a, b, c)
    | _ -> failwith ""

let () =
  let t = c * 2 - a - b in
  Printf.printf "%d\n" @@ if t mod 2 = 0 then t / 2 else (t + 3) / 2