module A where

main :: IO ()
main = do
  a : b : c : _ <- map read . words <$> getContents

  print $ length $ iterateM f (a, b, c)

f :: (Int, Int, Int) -> Maybe (Int, Int, Int)
f (a, b, c)
  | anyOdd a b c = Nothing
  | otherwise = Just ((b + c) `div` 2, (a + c) `div` 2, (a + b) `div` 2)

anyOdd :: Int -> Int -> Int -> Bool
anyOdd a b c = odd a || odd b || odd c

iterateM :: (a -> Maybe a) -> a -> [a]
iterateM f z = case f z of
  Nothing -> [z]
  Just x -> z : iterateM f x
