module IntTripleSet = Set.Make (struct
  type t = int * int * int
  let compare = compare
end)

let rec solve acc history a b c =
  if IntTripleSet.mem (a, b, c) history then -1
  else if a mod 2 = 1 || b mod 2 = 1 || c mod 2 = 1 then acc
  else
    solve
      (1 + acc)
      (IntTripleSet.add (a, b, c) history)
      (b / 2 + c / 2)
      (a / 2 + c / 2)
      (a / 2 + b / 2)
let solve = solve 0 IntTripleSet.empty

let () =
  let a, b, c = Scanf.scanf "%d %d %d" (fun a b c -> a, b, c) in
  Printf.printf "%d\n" @@ solve a b c