solve a b c
  | cond1 = 0
  | cond2 = -1
  | otherwise = 1 + solve a' b' c'
    where
      cond1 = ((mod a 2) + (mod b 2) + (mod c 2)) > 0
      cond2 = (a==b) && (b==c) && (c==a)
      da = div a 2
      db = div b 2
      dc = div c 2
      a' = db+dc
      b' = da+dc
      c' = da+db

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