output_description: Print the minimum total cost required to collect all the balls.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      x_1 y_1
      :
      x_N y_N
attempt: import sys
  
  sys.setrecursionlimit(4100000)
  
  
  def inputs(num_of_input):
      ins = [input() for i in range(num_of_input)]
      return ins
  
  
  def solve(inputs):
      points = []
      for i in inputs:
          points.append(string_to_int(i))
      N = len(points)
  
      if N == 1 or N == 2:
          return 1
  
      min = None
  
      for i, _ in enumerate(points):
          for j in range(i + 1, N):
              try_p = points[i][0] - points[j][0]
              try_q = points[i][1] - points[j][1]
  
              a = try_q / try_p if try_p != 0 else 0
  
              bs = {}
              hits = {x: None for x in range(0, N)}
              for try_i, _ in enumerate(points):
                  for try_j in range(try_i + 1, N):
                      diff_x = points[try_j][0] - points[try_i][0]
                      diff_y = points[try_j][1] - points[try_i][1]
  
                      check_a = diff_y / diff_x if diff_x != 0 else 0
                      if abs(a) != abs(check_a):
                          continue
  
                      check_b = (
                          (points[try_j][1] + points[try_i][1])
                          - check_a * (points[try_j][0] + points[try_i][0])
                      ) / 2
  
                      if check_b not in bs:
                          bs[check_b] = True
  
                      hits[try_i] = True
                      hits[try_j] = True
              count = len(bs)
              for value in hits.values():
                  if value is None:
                      count += 1
              if min is None or min > count:
                  min = count
      return min
  
  
  def string_to_int(string):
      return list(map(lambda x: int(x), string.split()))
  
  
  if __name__ == "__main__":
      [N] = string_to_int(input())
      ret = solve(inputs(N))
      print(ret)
  
problem_description: Statement
  
  There are N balls in a two-dimensional plane. The i-th ball is at coordinates
  (x_i, y_i).
  
  We will collect all of these balls, by choosing two integers p and q such that
  p \neq 0 or q \neq 0 and then repeating the following operation:
  
    * Choose a ball remaining in the plane and collect it. Let (a, b) be the coordinates of this ball. If we collected a ball at coordinates (a - p, b - q) in the previous operation, the cost of this operation is 0. Otherwise, including when this is the first time to do this operation, the cost of this operation is 1.
  
  Find the minimum total cost required to collect all the balls when we
  optimally choose p and q.
samples: [{"input": "2\n    1 1\n    2 2", "output": "1\n    \n\nIf we choose p = 1, q = 1, we can collect all the balls at a cost of 1 by\ncollecting them in the order (1, 1), (2, 2).\n\n* * *"}, {"input": "3\n    1 4\n    4 6\n    7 8", "output": "1\n    \n\nIf we choose p = -3, q = -2, we can collect all the balls at a cost of 1 by\ncollecting them in the order (7, 8), (4, 6), (1, 4).\n\n* * *"}, {"input": "4\n    1 1\n    1 2\n    2 1\n    2 2", "output": "2"}]