import Data.List

f :: Int -> Int -> Int-> Int
f a b c = ff 0 (y-x) (z-x) 
  where [x,y,z] = sort [a,b,c]

ff ::Int -> Int -> Int-> Int
ff a b c
  | length odds == 1 = 1 + ff x y z
  | length odds == 2 = 2 + ff x y z
  | otherwise        = (c - a + c - b) `div` 2
  where xs             = [a,b,c]
        (odds , evens) = partition odd xs
        [x,y,z] = sort $ map (subtract 1) odds ++ evens

main = do
   [a,b,c] <- map read . words <$> getLine
   print $ f a b c