from itertools import combinations
from collections import Counter

N = int(input())
xy = [tuple(map(int, input().split())) for _ in range(N)]

if N != 1:
    delta = []
    for i, j in combinations(list(range(N)), 2):
        if xy[i][0] < xy[j][0]:
            p0 = xy[i][:]
            p1 = xy[j][:]
        else:
            p0 = xy[j][:]
            p1 = xy[i][:]
        delta.append((p1[0] - p0[0], p1[1] - p0[1]))
    cnt = Counter(delta)
    dlt = cnt.most_common()
    
def calc(dd):
    visited =set()
    c = 0
    for i in range(N):
        if xy[i] in visited:continue
        c += 1
        temp = [[xy[i], c]]
        while temp:
            q = temp.pop()
            for n in [1, -1]:
                x1, y1 = q[0][0] + n * dd[0], q[0][1] + n * dd[1]
                if not (x1, y1) in visited and (x1, y1) in xy:
                    temp.append([(x1, y1), q[1]])
                    visited.add((x1, y1))
    return c

if N == 1: print(1)
else:
    ans = []
    pre = dlt[0][1]
    for lst in dlt:
        ans.append(calc(lst[0]))
    print(min(ans)) from itertools import combinations from collections import Counter N = int(input()) N int(input()) int input() input tuple(map(int, input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split xy = [tuple(map(int, input().split())) for _ in range(N)] xy [tuple(map(int, input().split())) for _ in range(N)] if N != 1:
    delta = []
    for i, j in combinations(list(range(N)), 2):
        if xy[i][0] < xy[j][0]:
            p0 = xy[i][:]
            p1 = xy[j][:]
        else:
            p0 = xy[j][:]
            p1 = xy[i][:]
        delta.append((p1[0] - p0[0], p1[1] - p0[1]))
    cnt = Counter(delta)
    dlt = cnt.most_common()
     N != 1 N 1 delta = [] delta [] for i, j in combinations(list(range(N)), 2):
        if xy[i][0] < xy[j][0]:
            p0 = xy[i][:]
            p1 = xy[j][:]
        else:
            p0 = xy[j][:]
            p1 = xy[i][:]
        delta.append((p1[0] - p0[0], p1[1] - p0[1]))
     i j combinations(list(range(N)), 2) combinations list(range(N)) list range(N) range N 2 if xy[i][0] < xy[j][0]:
            p0 = xy[i][:]
            p1 = xy[j][:]
        else:
            p0 = xy[j][:]
            p1 = xy[i][:]
         xy[i][0] < xy[j][0] xy[i][0] [i] xy i 0 xy[j][0] [j] xy j 0 p0 = xy[i][:] p0 xy[i][:] [i] xy i : p1 = xy[j][:] p1 xy[j][:] [j] xy j : p0 = xy[j][:] p0 xy[j][:] [j] xy j : p1 = xy[i][:] p1 xy[i][:] [i] xy i : delta.append((p1[0] - p0[0], p1[1] - p0[1])) delta.append delta append (p1[0] - p0[0], p1[1] - p0[1]) p1[0] - p0[0] p1[0] p1 0 p0[0] p0 0 p1[1] - p0[1] p1[1] p1 1 p0[1] p0 1 cnt = Counter(delta) cnt Counter(delta) Counter delta dlt = cnt.most_common() dlt cnt.most_common() cnt.most_common cnt most_common def calc(dd):
    visited =set()
    c = 0
    for i in range(N):
        if xy[i] in visited:continue
        c += 1
        temp = [[xy[i], c]]
        while temp:
            q = temp.pop()
            for n in [1, -1]:
                x1, y1 = q[0][0] + n * dd[0], q[0][1] + n * dd[1]
                if not (x1, y1) in visited and (x1, y1) in xy:
                    temp.append([(x1, y1), q[1]])
                    visited.add((x1, y1))
    return c calc visited =set() visited set() set c = 0 c 0 for i in range(N):
        if xy[i] in visited:continue
        c += 1
        temp = [[xy[i], c]]
        while temp:
            q = temp.pop()
            for n in [1, -1]:
                x1, y1 = q[0][0] + n * dd[0], q[0][1] + n * dd[1]
                if not (x1, y1) in visited and (x1, y1) in xy:
                    temp.append([(x1, y1), q[1]])
                    visited.add((x1, y1))
     i range(N) range N if xy[i] in visited:continue
         xy[i] in visited xy[i] xy i visited c += 1 c 1 temp = [[xy[i], c]] temp [[xy[i], c]] [xy[i], c] xy[i] xy i c while temp:
            q = temp.pop()
            for n in [1, -1]:
                x1, y1 = q[0][0] + n * dd[0], q[0][1] + n * dd[1]
                if not (x1, y1) in visited and (x1, y1) in xy:
                    temp.append([(x1, y1), q[1]])
                    visited.add((x1, y1))
     temp q = temp.pop() q temp.pop() temp.pop temp pop for n in [1, -1]:
                x1, y1 = q[0][0] + n * dd[0], q[0][1] + n * dd[1]
                if not (x1, y1) in visited and (x1, y1) in xy:
                    temp.append([(x1, y1), q[1]])
                    visited.add((x1, y1))
     n [1, -1] 1 -1 x1, y1 = q[0][0] + n * dd[0], q[0][1] + n * dd[1] x1 q[0][0] + n * dd[0] q[0][0] [0] q 0 0 n * dd[0] n dd[0] dd 0 y1 q[0][1] + n * dd[1] q[0][1] [0] q 0 1 n * dd[1] n dd[1] dd 1 if not (x1, y1) in visited and (x1, y1) in xy:
                    temp.append([(x1, y1), q[1]])
                    visited.add((x1, y1))
     not (x1, y1) in visited and (x1, y1) in xy not (x1, y1) in visited (x1, y1) in visited (x1, y1) x1 y1 visited (x1, y1) in xy (x1, y1) x1 y1 xy temp.append([(x1, y1), q[1]]) temp.append temp append [(x1, y1), q[1]] (x1, y1) x1 y1 q[1] q 1 visited.add((x1, y1)) visited.add visited add (x1, y1) x1 y1 return c c dd dd if N == 1: print(1)
else:
    ans = []
    pre = dlt[0][1]
    for lst in dlt:
        ans.append(calc(lst[0]))
    print(min(ans)) N == 1 N 1 ans = [] ans [] pre = dlt[0][1] pre dlt[0][1] [0] dlt 0 1 for lst in dlt:
        ans.append(calc(lst[0]))
     lst dlt ans.append(calc(lst[0])) ans.append ans append calc(lst[0]) calc lst[0] lst 0 print(min(ans)) print min(ans) min ans delta = [] [] delta p1 = xy[j][:] xy[j][:] p1 p1 = xy[i][:] xy[i][:] p1 N = int(input()) int(input()) N def calc(dd):
    visited =set()
    c = 0
    for i in range(N):
        if xy[i] in visited:continue
        c += 1
        temp = [[xy[i], c]]
        while temp:
            q = temp.pop()
            for n in [1, -1]:
                x1, y1 = q[0][0] + n * dd[0], q[0][1] + n * dd[1]
                if not (x1, y1) in visited and (x1, y1) in xy:
                    temp.append([(x1, y1), q[1]])
                    visited.add((x1, y1))
    return c def calc(dd):
    visited =set()
    c = 0
    for i in range(N):
        if xy[i] in visited:continue
        c += 1
        temp = [[xy[i], c]]
        while temp:
            q = temp.pop()
            for n in [1, -1]:
                x1, y1 = q[0][0] + n * dd[0], q[0][1] + n * dd[1]
                if not (x1, y1) in visited and (x1, y1) in xy:
                    temp.append([(x1, y1), q[1]])
                    visited.add((x1, y1))
    return c calc xy = [tuple(map(int, input().split())) for _ in range(N)] [tuple(map(int, input().split())) for _ in range(N)] xy p0 = xy[j][:] xy[j][:] p0 cnt = Counter(delta) Counter(delta) cnt ans = [] [] ans dlt = cnt.most_common() cnt.most_common() dlt pre = dlt[0][1] dlt[0][1] pre p0 = xy[i][:] xy[i][:] p0
from itertools import combinations
from collections import Counter

N = int(input())
xy = [tuple(map(int, input().split())) for _ in range(N)]

if N != 1:
    delta = []
    for i, j in combinations(list(range(N)), 2):
        if xy[i][0] < xy[j][0]:
            p0 = xy[i][:]
            p1 = xy[j][:]
        else:
            p0 = xy[j][:]
            p1 = xy[i][:]
        delta.append((p1[0] - p0[0], p1[1] - p0[1]))
    cnt = Counter(delta)
    dlt = cnt.most_common()
    
def calc(dd):
    visited =set()
    c = 0
    for i in range(N):
        if xy[i] in visited:continue
        c += 1
        temp = [[xy[i], c]]
        while temp:
            q = temp.pop()
            for n in [1, -1]:
                x1, y1 = q[0][0] + n * dd[0], q[0][1] + n * dd[1]
                if not (x1, y1) in visited and (x1, y1) in xy:
                    temp.append([(x1, y1), q[1]])
                    visited.add((x1, y1))
    return c

if N == 1: print(1)
else:
    ans = []
    pre = dlt[0][1]
    for lst in dlt:
        ans.append(calc(lst[0]))
    print(min(ans))