N = gets.to_i
pos = readlines.map {|a| a.split.map(&:to_i) }
if pos.size == 1
  puts 1
else
  pp = pos.map(&:first).sort.each_cons(2).map {|a,b| b - a }.uniq
  qq = pos.map(&:last).sort.each_cons(2).map {|a,b| b - a }.uniq
  puts pp.product(qq).map {|p,q|
    pos.each_cons(2).count {|a,b| b[0]-p != a[0] || b[1]-q != a[1] } + 1
  }.min
end