solve a b c
  | cond = 1 + solve a' b' c'
  | 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
      a' = db+dc
      b' = da+dc
      c' = da+db

main = do
  [a,b,c] <- map read . words <$> getLine :: IO [Int]
  print $
    if ((a==b) && (b==c) && (c==a))
      then -1
      else solve a b c
