def calc_cost(n, points, p, q)
  edges = [nil] * n
  n.times do |i|
    edges[i] = [false] * n
  end
  
  n.times do |k|
    a = points[k][:x]
    b = points[k][:y]
    
    t = points.find_index({:x => a - p, :y => b - q})
    if t != nil then
      edges[k][t] = true
      edges[t][k] = true
    end
  end
  
  count = 0
  flags = [false] * n
  n.times do |k|
    next if flags[k]
    
    flags[k] = true
    count += 1
    
    q = [k]
    while !q.empty? do
      s = q.pop
      
      n.times do |d|
        if edges[s][d] && (!flags[d]) then
          flags[d] = true
          q.push(d)
        end
      end
    end
  end
  
  return count
end

def main(argv)
  n = gets.chomp.to_i
  
  points = [nil] * n
  n.times do |i|
    (x, y) = gets.chomp.split(' ').map(&:to_i)
    points[i] = {:x => x, :y => y}
  end
  
  ans = 1e+9.to_i
  n.times do |i|
    n.times do |j|
      next if i == j
      
      p = points[j][:x] - points[i][:x]
      q = points[j][:y] - points[i][:y]
      
      ans = [ans, calc_cost(n, points, p, q)].min
    end
  end
  
  puts ans.to_s
end

if self.to_s == 'main' then
  main(ARGV)
end