import Data.List

main = getLine >>= putStrLn . maybe "-1" show . untilodd . map read . words

untilodd [a,b,c]
 | any odd [a,b,c] = Just 0
 | a==b && b==c = Nothing
 | otherwise = Just $ length $ unfoldr exchange [a,b,c]

exchange [a,b,c]
 | any odd [a,b,c] = Nothing
 | otherwise = Just (next, next)
  where next = [div b 2 + div c 2, div a 2 + div c 2, div a 2 + div b 2]