import Control.Applicative ((<$>))
import Data.List

main :: IO ()
main = solve <$> map read <$> words <$> getLine >>= print

solve :: [Int] -> Int
solve xs
  | even s = s `div` 2
  | otherwise = (s + 3) `div` 2
  where
    [a, b, c] = sort xs
    s = 2*c-a-b
