def main():

    N = int(input())

    A = [[int(i) for i in input().split()] for j in range(N)]

    if N == 1:

        return print(1)

    A.sort()

    from collections import defaultdict

    cnt = defaultdict(int)

    for i in range(N):

        for j in range(i+1, N):

            # print(A[i], A[j], (A[j][0] - A[i][0], A[j][1] - A[i][1]))

            cnt[(A[j][0] - A[i][0], A[j][1] - A[i][1])] += 1

    # print(cnt.values())

    ans = (N-1) - (sorted(cnt.values())[-1] - 1)

    print(ans)





if __name__ == '__main__':

    main()

def main():

    import sys

    input = sys.stdin.buffer.readline

    N = int(eval(input()))

    XY = [[int(i) for i in input().split()] for j in range(N)]

    XY.sort()

    from collections import Counter

    c = Counter()

    for i in range(N-1):

        for j in range(i+1, N):

            p = XY[j][0] - XY[i][0]

            q = XY[j][1] - XY[i][1]

            c[(p, q)] += 1

    ans = N - (c.most_common()[0][1] if c else 0)

    print(ans)





if __name__ == '__main__':

    main()

def main():
    N = int(input())
    A = [[int(i) for i in input().split()] for j in range(N)]
    if N == 1:
        return print(1)
    A.sort()
    from collections import defaultdict

    cnt = defaultdict(int)
    for i in range(N):
        for j in range(i + 1, N):
            # print(A[i], A[j], (A[j][0] - A[i][0], A[j][1] - A[i][1]))
            cnt[(A[j][0] - A[i][0], A[j][1] - A[i][1])] += 1
    # print(cnt.values())
    ans = (N - 1) - (sorted(cnt.values())[-1] - 1)
    print(ans)


if __name__ == "__main__":
    main()

def main():
    import sys

    input = sys.stdin.buffer.readline
    N = int(eval(input()))
    XY = [[int(i) for i in input().split()] for j in range(N)]
    XY.sort()
    from collections import Counter

    c = Counter()
    for i in range(N - 1):
        for j in range(i + 1, N):
            p = XY[j][0] - XY[i][0]
            q = XY[j][1] - XY[i][1]
            c[(p, q)] += 1
    ans = N - (c.most_common()[0][1] if c else 0)
    print(ans)


if __name__ == "__main__":
    main()

-    N = int(input()) -    A = [[int(i) for i in input().split()] for j in range(N)] -    if N == 1: -        return print(1) -    A.sort() -    from collections import defaultdict +    import sys -    cnt = defaultdict(int) -    for i in range(N): +    input = sys.stdin.buffer.readline +    N = int(eval(input())) +    XY = [[int(i) for i in input().split()] for j in range(N)] +    XY.sort() +    from collections import Counter + +    c = Counter() +    for i in range(N - 1): -            # print(A[i], A[j], (A[j][0] - A[i][0], A[j][1] - A[i][1])) -            cnt[(A[j][0] - A[i][0], A[j][1] - A[i][1])] += 1 -    # print(cnt.values()) -    ans = (N - 1) - (sorted(cnt.values())[-1] - 1) +            p = XY[j][0] - XY[i][0] +            q = XY[j][1] - XY[i][1] +            c[(p, q)] += 1 +    ans = N - (c.most_common()[0][1] if c else 0)