import Data.List

solve :: Int -> Int -> Int -> Int
solve a b c =
  (div (z - x) 2) + (div (z - y) 2) + 
   case ((z - x) `mod` 2) + ((z - y) `mod`2) of
     0 -> 0
     1 -> 2
     2 -> 1
  where
    [x,y,z] = sort [a,b,c]


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