Distinct Distances

Choose any point q in the plane and minimize the number of distinct Euclidean distances from q to n given integer points.

Hard8GeometryMathBrute forceCombinatoricsNo attempts yetTime limit3sMemory limit512 MB

Problem

You are setting up a scavenger hunt in the two-dimensional plane.

You have already chosen nn distinct points of interest, labeled p1,p2,,pnp_1, p_2, \dots, p_n. Point pip_i sits at the integer coordinates (xi,yi)(x_i, y_i).

Now you want to choose one more point qq for the final location. The coordinates of qq must be finite, but they do not have to be integers. Point qq may coincide with one of the points pip_i.

To make the final location interesting, you want to minimize how many distinct distances there are from qq to the chosen points. Formally, choose qq that minimizes S(q)|S(q)|, where

S(q)={qp1, qp2, , qpn}.S(q) = \{\,|q - p_1|,\ |q - p_2|,\ \dots,\ |q - p_n|\,\}.

Here S(q)|S(q)| is the number of elements of S(q)S(q), and qpi|q - p_i| is the Euclidean distance between qq and pip_i. S(q)S(q) is a set, so if two or more of the distances qpi|q - p_i| are equal, they count as a single element.

Given the coordinates of the points, find the minimum value of S(q)|S(q)|.

Warning: inexact arithmetic may make it difficult to identify distances that are exactly equal.

Input

The first line contains one integer nn (1n401 \le n \le 40).

Each of the next nn lines contains two space-separated integers xix_i and yiy_i (xi,yi300|x_i|, |y_i| \le 300), the coordinates of pip_i. The nn points are pairwise distinct.

Output

Print on a single line the minimum number of distinct distances from qq to all of the points pip_i.

Hint

In the first sample you can take q=(0,0)q = (0, 0), and every point is at distance 5. In the second sample you can take q=(1.5,1.5)q = (1.5, 1.5).