from collections import deque
n=int(input())
ans=10**18
xy=[list(map(int,input().split())) for _ in range(n)]
d=dict()
for i in range(n):
    a,b=xy[i]
    d[(a,b)]=i
def bfs(s,p,q,visited):
    queue=deque([s])
    visited[s]=1
    while queue:
        x=queue.popleft()
        a,b=xy[x]
        if (a+p,b+q) in d:
            idx=d[(a+p,b+q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx)
        if (a-p,b-q) in d:
            idx=d[(a-p,b-q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx)
for i in range(n-1):
    ai,bi=xy[i]
    for j in range(i+1,n):
        aj,bj=xy[j]
        p,q=ai-aj,bi-bj
        cnt=0
        visited=[0]*n
        for k in range(n):
            if visited[k]==0:
                bfs(k,p,q,visited)
                cnt+=1
        ans=min(ans,cnt)
if n==1:
    ans=1
print(ans)
#print(d) from collections import deque n=int(input()) n int(input()) int input() input ans=10**18 ans 10**18 10 18 list(map(int,input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split xy=[list(map(int,input().split())) for _ in range(n)] xy [list(map(int,input().split())) for _ in range(n)] d=dict() d dict() dict for i in range(n):
    a,b=xy[i]
    d[(a,b)]=i i range(n) range n a,b=xy[i] a xy[i] xy i b d[(a,b)]=i d[(a,b)] d (a,b) a b i def bfs(s,p,q,visited):
    queue=deque([s])
    visited[s]=1
    while queue:
        x=queue.popleft()
        a,b=xy[x]
        if (a+p,b+q) in d:
            idx=d[(a+p,b+q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx)
        if (a-p,b-q) in d:
            idx=d[(a-p,b-q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx) bfs queue=deque([s]) queue deque([s]) deque [s] s visited[s]=1 visited[s] visited s 1 while queue:
        x=queue.popleft()
        a,b=xy[x]
        if (a+p,b+q) in d:
            idx=d[(a+p,b+q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx)
        if (a-p,b-q) in d:
            idx=d[(a-p,b-q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx) queue x=queue.popleft() x queue.popleft() queue.popleft queue popleft a,b=xy[x] a xy[x] xy x b if (a+p,b+q) in d:
            idx=d[(a+p,b+q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx)
         (a+p,b+q) in d (a+p,b+q) a+p a p b+q b q d idx=d[(a+p,b+q)] idx d[(a+p,b+q)] d (a+p,b+q) a+p a p b+q b q if visited[idx]==0:
                visited[idx]=1
                queue.append(idx)
         visited[idx]==0 visited[idx] visited idx 0 visited[idx]=1 visited[idx] visited idx 1 queue.append(idx) queue.append queue append idx if (a-p,b-q) in d:
            idx=d[(a-p,b-q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx) (a-p,b-q) in d (a-p,b-q) a-p a p b-q b q d idx=d[(a-p,b-q)] idx d[(a-p,b-q)] d (a-p,b-q) a-p a p b-q b q if visited[idx]==0:
                visited[idx]=1
                queue.append(idx) visited[idx]==0 visited[idx] visited idx 0 visited[idx]=1 visited[idx] visited idx 1 queue.append(idx) queue.append queue append idx s s p p q q visited visited for i in range(n-1):
    ai,bi=xy[i]
    for j in range(i+1,n):
        aj,bj=xy[j]
        p,q=ai-aj,bi-bj
        cnt=0
        visited=[0]*n
        for k in range(n):
            if visited[k]==0:
                bfs(k,p,q,visited)
                cnt+=1
        ans=min(ans,cnt) i range(n-1) range n-1 n 1 ai,bi=xy[i] ai xy[i] xy i bi for j in range(i+1,n):
        aj,bj=xy[j]
        p,q=ai-aj,bi-bj
        cnt=0
        visited=[0]*n
        for k in range(n):
            if visited[k]==0:
                bfs(k,p,q,visited)
                cnt+=1
        ans=min(ans,cnt) j range(i+1,n) range i+1 i 1 n aj,bj=xy[j] aj xy[j] xy j bj p,q=ai-aj,bi-bj p ai-aj ai aj q bi-bj bi bj cnt=0 cnt 0 visited=[0]*n visited [0]*n [0] 0 n for k in range(n):
            if visited[k]==0:
                bfs(k,p,q,visited)
                cnt+=1
         k range(n) range n if visited[k]==0:
                bfs(k,p,q,visited)
                cnt+=1
         visited[k]==0 visited[k] visited k 0 bfs(k,p,q,visited) bfs k p q visited cnt+=1 cnt 1 ans=min(ans,cnt) ans min(ans,cnt) min ans cnt if n==1:
    ans=1 n==1 n 1 ans=1 ans 1 print(ans) print ans bi=xy[i] xy[i] bi n=int(input()) int(input()) n a,b=xy[i] xy[i] a ai,bi=xy[i] xy[i] ai p,q=ai-aj,bi-bj ai-aj p ans=10**18 10**18 ans d=dict() dict() d aj,bj=xy[j] xy[j] aj cnt=0 0 cnt def bfs(s,p,q,visited):
    queue=deque([s])
    visited[s]=1
    while queue:
        x=queue.popleft()
        a,b=xy[x]
        if (a+p,b+q) in d:
            idx=d[(a+p,b+q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx)
        if (a-p,b-q) in d:
            idx=d[(a-p,b-q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx) def bfs(s,p,q,visited):
    queue=deque([s])
    visited[s]=1
    while queue:
        x=queue.popleft()
        a,b=xy[x]
        if (a+p,b+q) in d:
            idx=d[(a+p,b+q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx)
        if (a-p,b-q) in d:
            idx=d[(a-p,b-q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx) bfs b=xy[i] xy[i] b visited=[0]*n [0]*n visited ans=min(ans,cnt) min(ans,cnt) ans q=ai-aj,bi-bj bi-bj q xy=[list(map(int,input().split())) for _ in range(n)] [list(map(int,input().split())) for _ in range(n)] xy cnt+=1 1 cnt bj=xy[j] xy[j] bj ans=1 1 ans
from collections import deque
n=int(input())
ans=10**18
xy=[list(map(int,input().split())) for _ in range(n)]
d=dict()
for i in range(n):
    a,b=xy[i]
    d[(a,b)]=i
def bfs(s,p,q,visited):
    queue=deque([s])
    visited[s]=1
    while queue:
        x=queue.popleft()
        a,b=xy[x]
        if (a+p,b+q) in d:
            idx=d[(a+p,b+q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx)
        if (a-p,b-q) in d:
            idx=d[(a-p,b-q)]
            if visited[idx]==0:
                visited[idx]=1
                queue.append(idx)
for i in range(n-1):
    ai,bi=xy[i]
    for j in range(i+1,n):
        aj,bj=xy[j]
        p,q=ai-aj,bi-bj
        cnt=0
        visited=[0]*n
        for k in range(n):
            if visited[k]==0:
                bfs(k,p,q,visited)
                cnt+=1
        ans=min(ans,cnt)
if n==1:
    ans=1
print(ans)
#print(d)