a,b=gets.split.map(&:to_i) c,d=gets.split.map(&:to_i) p (a-c).abs/2+(b-d).abs/2