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

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