n = gets.to_i
bs = n.times.map{gets.chomp.split.map(&:to_i)}.sort_by(&:last).sort_by(&:first)
lengs = {}
cur_x,cur_y = bs.shift
bs.each do |x,y|
  leng = (cur_x - x) + (cur_y - y)
  if lengs[leng]
    lengs[leng] += 1
  else
    lengs[leng] = 1
  end
  cur_x ,cur_y = x , y
end

puts n - lengs.sort_by(&:last)[-1][1]