open Batteries

let read_two () = Scanf.sscanf (read_line ()) "%d %d" (fun a b -> (a, b))

let read_three () =
  Scanf.sscanf (read_line ()) "%d %d %d" (fun a b c -> (a, b, c))

let read_four () =
  Scanf.sscanf (read_line ()) "%d %d %d" (fun a b c d -> (a, b, c, d))

let read_list () =
  read_line () |> String.split_on_char ' '
  |> List.map (fun s -> int_of_string s)

(* a**x *)
let pow a x =
  let rec aux acc = function 0 -> acc | n -> aux (acc * a) (n - 1) in
  aux 1 x

let rec pow2 n = if n mod 2 = 0 then 1 + pow2 (n / 2) else 0

let rec f a b c =
  if a = b && b = c then -1
  else if a mod 2 <> 0 || b mod 2 <> 0 || c mod 2 <> 0 then 0
  else
    let aa = a / 2 and bb = b / 2 and cc = c / 2 in
    f (bb + cc) (aa + cc) (aa + bb) + 1

let () =
  let a, b, c = read_three () in
  let ans = f a b c in
  print_int ans;
  print_newline ()
