import Data.List

solver::Int->Int->Int->Int
solver x y z = let c:b:a:[]=sort [x,y,z] in
               if mod  ((a-b)+(a-c)) 2 == 0 then div ((a-b)+(a-c)) 2 else div (((a-b)+(a-c))+3) 2

main::IO()
main=do
  abcc<-getLine
  let a:b:c:[]=map read (words abcc)
  print (solver a b c)
