def ii() gets.chomp.to_i end def li() gets.chomp.split.map(&:to_i) end a,b,c,d=li() if a==c||b==d||(a-c).abs+(b-d).abs<=3 puts 1 else puts 2 end