import Control.Applicative
import Control.Monad
import Data.List
import Data.Array
import Data.Char

main = do
  [a, b, c] <- sort . map (read::String -> Int) . words <$> getLine
  let evenNum = foldl (\acc num -> if num `mod` 2 == 0 then acc + 1 else acc) 0 [a, b, c]
  print $ case evenNum of
    1 -> let new_a = if a `mod` 2 == 0 then a else a + 1
             new_b = if b `mod` 2 == 0 then b else b + 1
             new_c = if c `mod` 2 == 0 then c else c + 1
         in ((new_c - new_a) `div` 2) + ((new_c - new_b) `div` 2) + 1
    2 -> let new_a = if a `mod` 2 == 1 then a else a + 1
             new_b = if b `mod` 2 == 1 then b else b + 1
             new_c = if c `mod` 2 == 1 then c else c + 1
         in ((new_c - new_a) `div` 2) + ((new_c - new_b) `div` 2) + 1
    _ -> ((c - a) `div` 2) + ((c - b) `div` 2)