
let odd x = x mod 2 <> 0
                         
let solve a b c =
  let rec iter x y z acc =
    if (odd x) || (odd y) || (odd z) then acc
    else
      if (x = y) && (y = z) then (-1)
      else
        iter ((y+z) / 2) ((x+z) / 2) ((z+x) / 2) (acc + 1) in iter a b c 0

let () =
  let a, b, c = Scanf.scanf "%d %d %d" (fun x y z -> (x, y, z)) in
  print_endline @@ string_of_int @@ solve a b c
