import Control.Applicative
import Data.List

check :: [Integer] -> Integer
check [a, b, c] 
    | mod b 2 == mod a 2 && mod a 2 == mod c 2 = (div (c - a) 2) + (div (c - b) 2)
    | mod a 2 == mod b 2 = 1 + check [a + 1, b + 1, c]
    | mod a 2 == mod c 2 = 1 + check [a + 1, b, c + 1]
    | otherwise =  1 + check [a, b + 1, c + 1]

main = print =<< check <$> sort . map (\a -> read a :: Integer) <$> words <$> getLine
