(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let i = ref 0

let rec f a b c =
        if a mod 2 = 1 && b mod 2 = 1 && c mod 2 = 1 then
                0
        else if a = b && a = c && b = c then
                -1
        else if a mod 2 = 1 || b mod 2 = 1 || c mod 2 = 1 then
                !i
        else
                let na = (b + c) / 2 in
                let nb = (a + c) / 2 in
                let nc = (a + b) / 2 in
                        incr i;
                        f na nb nc

let () =
        Scanf.sscanf (read_line ()) "%d %d %d" (
                fun a b c -> 
                        f a b c
        ) |> Printf.printf "%d\n"
