module Main where

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

countOperation :: Integer -> Integer -> Integer -> Integer
countOperation a b c = foldl count init m 
  where 
    m = format a b c
    max = maximum m
    init = if [a, b, c] /= m then 1 else 0
    count acc y = acc + (max - y) `div` 2


format :: Integer -> Integer -> Integer -> [ Integer ]
format a b c | hoge = xs
                     | poyo = toEven
                     | bazz = toOdd
 where
  xs     = [a, b, c]
  hoge   = length (filter even xs) == 3 || length (filter odd xs) == 3
  poyo   = length (filter odd xs) == 2
  bazz   = length (filter even xs) == 2
  toEven = map fuga xs
  toOdd  = map fizz xs
  fuga x = if odd x then x + 1 else x
  fizz x = if even x then x + 1 else x
