import Data.List

main = do
  [a,b,c] <- fmap (sort . map read . words) getLine
  print (solve a b c)

solve :: Int -> Int -> Int -> Int
solve a b c =
  op1 + op2 + 2*r
  where
    op1     = c-b
    (op2,r) = (b-a)`divMod`2