import Control.Applicative
import Control.Monad
import Data.List

solve :: Int -> Int -> Int -> Int
solve a b c
    | any odd [a, b, c] = 0
    | all (== a) [b, c] = -1
    | otherwise         = go 0 a b c
  where
    go k a b c
        | any odd [a, b, c] = k
        | otherwise         = k' `seq` go k' (b2 + c2) (a2 + c2) (a2 + b2)
      where
        k' = k + 1
        a2 = a `div` 2
        b2 = b `div` 2
        c2 = c `div` 2

main :: IO ()
main = do
    [a, b, c] <- fmap read . words <$> getLine :: IO [Int]
    print $ solve a b c