import sys
def input(): return sys.stdin.readline().rstrip()
from itertools import combinations
from collections import Counter
def main():
    n=int(input())
    if n==1:
        print(1)
        sys.exit()
    XY=[tuple(map(int,input().split())) for i in range(n)]
    XY.sort()
    lis=list(combinations(XY,2))
    PQ=[]
    for l in lis:
        PQ.append((l[1][0]-l[0][0],l[1][1]-l[0][1]))
    x=Counter(PQ).most_common(1)[0][1]
    print(n-x)

if __name__=='__main__':
    main() import sys sys def input(): return sys.stdin.readline().rstrip() input from itertools import combinations from collections import Counter def main():
    n=int(input())
    if n==1:
        print(1)
        sys.exit()
    XY=[tuple(map(int,input().split())) for i in range(n)]
    XY.sort()
    lis=list(combinations(XY,2))
    PQ=[]
    for l in lis:
        PQ.append((l[1][0]-l[0][0],l[1][1]-l[0][1]))
    x=Counter(PQ).most_common(1)[0][1]
    print(n-x) main n=int(input()) n int(input()) int input() input if n==1:
        print(1)
        sys.exit()
     n==1 n 1 print(1) print 1 sys.exit() sys.exit sys exit tuple(map(int,input().split())) for i in range(n) for i in range(n) i range(n) range n for i 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 i in range(n)] XY [tuple(map(int,input().split())) for i in range(n)] XY.sort() XY.sort XY sort lis=list(combinations(XY,2)) lis list(combinations(XY,2)) list combinations(XY,2) combinations XY 2 PQ=[] PQ [] for l in lis:
        PQ.append((l[1][0]-l[0][0],l[1][1]-l[0][1]))
     l lis PQ.append((l[1][0]-l[0][0],l[1][1]-l[0][1])) PQ.append PQ append (l[1][0]-l[0][0],l[1][1]-l[0][1]) l[1][0]-l[0][0] l[1][0] [1] l 1 0 l[0][0] [0] l 0 0 l[1][1]-l[0][1] l[1][1] [1] l 1 1 l[0][1] [0] l 0 1 x=Counter(PQ).most_common(1)[0][1] x Counter(PQ).most_common(1)[0][1] [0] (PQ).most_common(1) (PQ).most_common (PQ) Counter PQ most_common 1 0 1 print(n-x) print n-x n x if __name__=='__main__':
    main() __name__=='__main__' __name__ '__main__' main() main def main():
    n=int(input())
    if n==1:
        print(1)
        sys.exit()
    XY=[tuple(map(int,input().split())) for i in range(n)]
    XY.sort()
    lis=list(combinations(XY,2))
    PQ=[]
    for l in lis:
        PQ.append((l[1][0]-l[0][0],l[1][1]-l[0][1]))
    x=Counter(PQ).most_common(1)[0][1]
    print(n-x) def main():
    n=int(input())
    if n==1:
        print(1)
        sys.exit()
    XY=[tuple(map(int,input().split())) for i in range(n)]
    XY.sort()
    lis=list(combinations(XY,2))
    PQ=[]
    for l in lis:
        PQ.append((l[1][0]-l[0][0],l[1][1]-l[0][1]))
    x=Counter(PQ).most_common(1)[0][1]
    print(n-x) main def input(): return sys.stdin.readline().rstrip() def input(): return sys.stdin.readline().rstrip() input
import sys
def input(): return sys.stdin.readline().rstrip()
from itertools import combinations
from collections import Counter
def main():
    n=int(input())
    if n==1:
        print(1)
        sys.exit()
    XY=[tuple(map(int,input().split())) for i in range(n)]
    XY.sort()
    lis=list(combinations(XY,2))
    PQ=[]
    for l in lis:
        PQ.append((l[1][0]-l[0][0],l[1][1]-l[0][1]))
    x=Counter(PQ).most_common(1)[0][1]
    print(n-x)

if __name__=='__main__':
    main()