import Control.Monad
import Control.Applicative

swap :: (Int, Int, Int) -> Int -> Int
swap (x, y, z) n
  | x' == y' && y' == z'        = -1
  | odd x' || odd y' || odd z'  = n + 1
  | otherwise                   = swap (x', y', z') (n + 1)
  where x' = (x + y) `div` 2
        y' = (y + z) `div` 2
        z' = (z + x) `div` 2

main = do
  [a, b, c] <- map read . words <$> getLine
  let taple = (a, b, c)
  if odd a || odd b || odd c then putStrLn "0"
                             else putStrLn $ show $ swap taple 0
