import Control.Monad
import Data.List
import qualified Data.Set as S

main=do
    [a,b,c]<-sort.map read.words<$>getLine::IO[Int]
    print $ sol 0 S.empty (a,b,c)

sol::Int->S.Set (Int,Int,Int)->(Int,Int,Int)->Int
sol n s abc@(a,b,c)
    | any odd [a,b,c] = n
    | S.member abc s = -1
    | otherwise = sol (n+1) (S.insert abc s) (fn abc)

fn::(Int,Int,Int)->(Int,Int,Int)
fn (a,b,c) = (u,v,w)
    where
        a2 = a `div` 2
        b2 = b `div` 2
        c2 = c `div` 2
        a' = b2+c2
        b' = a2+c2
        c' = a2+b2
        (u:v:w:_) = sort [a',b',c']