import Control.Applicative

f a b c = do
  let p = if all odd [a, b, c] || all even [a, b, c] then 0 else 1
  let xs = map (`div` 2) [a,b,c]
  let m = maximum xs
  p + (sum $ map (m - ) xs)

main = do
  [a, b, c] <- map read <$> words <$> getLine :: IO [Int]
  --let [a, b, c] = [31,41,5]
  print $ f a b c
