
import Data.List

main = do
    [a, b, c] <- (map read . words) <$> getLine
    putStrLn . show $ solve 0 (a, b, c)

solve:: Int -> (Int, Int, Int) -> Int
solve n (a, b, c)
  | a == b && b == c = n
  | not $ ad (a, b, c) = solve (n + 1) $ addA (a, b, c)
  | otherwise = n + (kk $ mm (a, b, c))

mm:: (Int, Int, Int) -> (Int, Int)
mm (a, b, c) 
  | (a > b) && (b > c) = (a - c, b - c)
  | (a > c) && (c > b) = (a - b, c - b)
  | (b > a) && (a > c) = (b - c, a - c)
  | (b > c) && (c > a) = (b - a, c - a)
  | (c > a) && (a > b) = (c - b, a - b)
  | otherwise = (c - a, b - a)

kk (a, b) = (div a 2) + (div b 2)

  
ad:: (Int, Int, Int) -> Bool
ad (a, b, c)
  | am == 0 && bm == 0 && cm == 0 = True
  | am == 1 && bm == 1 && cm == 1 = True
  | otherwise = False
  where
      am = mod a 2
      bm = mod b 2
      cm = mod c 2

addA (a, b, c)
  | am == 0 && bm == 0 = (a + 1, b + 1, c)
  | am == 0 && cm == 0 = (a + 1, b, c + 1)
  | bm == 0 && cm == 0 = (a, b + 1, c + 1)
  | am == 1 && bm == 1 = (a + 1, b + 1, c)
  | am == 1 && cm == 1 = (a + 1, b, c + 1)
  | otherwise = (a, b + 1, c + 1)
  where
      am = mod a 2
      bm = mod b 2
      cm = mod c 2