let a_s = Array.init 3 @@ fun _ -> Scanf.scanf " %d" (+) 0
let ans = ref 500
let f i j k = ans := min !ans @@ abs (a_s.(i) - a_s.(j)) + abs (a_s.(j) - a_s.(k))
let _ =
  f 0 1 2; f 0 2 1; f 1 0 2; f 1 2 0; f 2 0 1; f 2 1 0;
  Printf.printf "%d\n" !ans