def main():
    import sys
    from collections import defaultdict
    input = sys.stdin.readline
    N = int(input())
    if N == 1:
        print(1)
        exit()
    XY = [0] * N
    for i, (x, y) in enumerate([[int(x) for x in input().strip().split()] for _ in range(N)]):
        XY[i] = (x, y)
    XY.sort(key=lambda x:(x[0], x[1]))

    dic = defaultdict(int)
    for d in range(1, N):
        for i in range(N-d):
            dic[(XY[i+d][0]-XY[i][0], XY[i+d][1]-XY[i][1])] += 1
            dic[(XY[i][0]-XY[i+d][0], XY[i][1]-XY[i+d][1])] += 1

    print(N-max(dic.values()))

if __name__ == '__main__':
    main() def main():
    import sys
    from collections import defaultdict
    input = sys.stdin.readline
    N = int(input())
    if N == 1:
        print(1)
        exit()
    XY = [0] * N
    for i, (x, y) in enumerate([[int(x) for x in input().strip().split()] for _ in range(N)]):
        XY[i] = (x, y)
    XY.sort(key=lambda x:(x[0], x[1]))

    dic = defaultdict(int)
    for d in range(1, N):
        for i in range(N-d):
            dic[(XY[i+d][0]-XY[i][0], XY[i+d][1]-XY[i][1])] += 1
            dic[(XY[i][0]-XY[i+d][0], XY[i][1]-XY[i+d][1])] += 1

    print(N-max(dic.values())) main import sys sys from collections import defaultdict input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N = int(input()) N int(input()) int input() input if N == 1:
        print(1)
        exit()
     N == 1 N 1 print(1) print 1 exit() exit XY = [0] * N XY [0] * N [0] 0 N for i, (x, y) in enumerate([[int(x) for x in input().strip().split()] for _ in range(N)]):
        XY[i] = (x, y)
     i (x, y) x y enumerate([[int(x) for x in input().strip().split()] for _ in range(N)]) enumerate [[int(x) for x in input().strip().split()] for _ in range(N)] XY[i] = (x, y) XY[i] XY i (x, y) x y XY.sort(key=lambda x:(x[0], x[1])) XY.sort XY sort key=lambda x:(x[0], x[1]) key lambda x:(x[0], x[1]) (x[0], x[1]) x[0] x 0 x[1] x 1 x dic = defaultdict(int) dic defaultdict(int) defaultdict int for d in range(1, N):
        for i in range(N-d):
            dic[(XY[i+d][0]-XY[i][0], XY[i+d][1]-XY[i][1])] += 1
            dic[(XY[i][0]-XY[i+d][0], XY[i][1]-XY[i+d][1])] += 1

     d range(1, N) range 1 N for i in range(N-d):
            dic[(XY[i+d][0]-XY[i][0], XY[i+d][1]-XY[i][1])] += 1
            dic[(XY[i][0]-XY[i+d][0], XY[i][1]-XY[i+d][1])] += 1

     i range(N-d) range N-d N d dic[(XY[i+d][0]-XY[i][0], XY[i+d][1]-XY[i][1])] += 1 dic[(XY[i+d][0]-XY[i][0], XY[i+d][1]-XY[i][1])] dic (XY[i+d][0]-XY[i][0], XY[i+d][1]-XY[i][1]) XY[i+d][0]-XY[i][0] XY[i+d][0] [i+d] XY i+d i d 0 XY[i][0] [i] XY i 0 XY[i+d][1]-XY[i][1] XY[i+d][1] [i+d] XY i+d i d 1 XY[i][1] [i] XY i 1 1 dic[(XY[i][0]-XY[i+d][0], XY[i][1]-XY[i+d][1])] += 1 dic[(XY[i][0]-XY[i+d][0], XY[i][1]-XY[i+d][1])] dic (XY[i][0]-XY[i+d][0], XY[i][1]-XY[i+d][1]) XY[i][0]-XY[i+d][0] XY[i][0] [i] XY i 0 XY[i+d][0] [i+d] XY i+d i d 0 XY[i][1]-XY[i+d][1] XY[i][1] [i] XY i 1 XY[i+d][1] [i+d] XY i+d i d 1 1 print(N-max(dic.values())) print N-max(dic.values()) N max(dic.values()) max dic.values() dic.values dic values if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    import sys
    from collections import defaultdict
    input = sys.stdin.readline
    N = int(input())
    if N == 1:
        print(1)
        exit()
    XY = [0] * N
    for i, (x, y) in enumerate([[int(x) for x in input().strip().split()] for _ in range(N)]):
        XY[i] = (x, y)
    XY.sort(key=lambda x:(x[0], x[1]))

    dic = defaultdict(int)
    for d in range(1, N):
        for i in range(N-d):
            dic[(XY[i+d][0]-XY[i][0], XY[i+d][1]-XY[i][1])] += 1
            dic[(XY[i][0]-XY[i+d][0], XY[i][1]-XY[i+d][1])] += 1

    print(N-max(dic.values())) def main():
    import sys
    from collections import defaultdict
    input = sys.stdin.readline
    N = int(input())
    if N == 1:
        print(1)
        exit()
    XY = [0] * N
    for i, (x, y) in enumerate([[int(x) for x in input().strip().split()] for _ in range(N)]):
        XY[i] = (x, y)
    XY.sort(key=lambda x:(x[0], x[1]))

    dic = defaultdict(int)
    for d in range(1, N):
        for i in range(N-d):
            dic[(XY[i+d][0]-XY[i][0], XY[i+d][1]-XY[i][1])] += 1
            dic[(XY[i][0]-XY[i+d][0], XY[i][1]-XY[i+d][1])] += 1

    print(N-max(dic.values())) main
def main():
    import sys
    from collections import defaultdict
    input = sys.stdin.readline
    N = int(input())
    if N == 1:
        print(1)
        exit()
    XY = [0] * N
    for i, (x, y) in enumerate([[int(x) for x in input().strip().split()] for _ in range(N)]):
        XY[i] = (x, y)
    XY.sort(key=lambda x:(x[0], x[1]))

    dic = defaultdict(int)
    for d in range(1, N):
        for i in range(N-d):
            dic[(XY[i+d][0]-XY[i][0], XY[i+d][1]-XY[i][1])] += 1
            dic[(XY[i][0]-XY[i+d][0], XY[i][1]-XY[i+d][1])] += 1

    print(N-max(dic.values()))

if __name__ == '__main__':
    main()