open System

let inline avg a b = (a + b) / 2

let rec f k (a,b,c) =
    if a=b && b=c then
        if a%2 = 0 then -1 else k
    elif (a%2)+(b%2)+(c%2) = 0 then
        f (k+1) (avg b c, avg c a, avg a b)
    else k
        
let [|a; b; c|] = stdin.ReadLine().Split() |> Array.map int

printfn "%d" <| f 0 (a,b,c)