import Data.List

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

solve :: Int -> Int -> Int -> Int
solve a b c | even (c-a) && even (c-b) = (c-a) `div` 2 + (c-b) `div` 2
            | even (c-a) || even (c-b) = (c-a) `div` 2 + (c-b) `div` 2 + 2
            | otherwise = (c-a-1) `div` 2 + (c-b-1) `div` 2 + 1
