import sys
from collections import defaultdict
from itertools import combinations

input = sys.stdin.readline


def main():
    N = int(input())
    x = [0] * N
    y = [0] * N
    for i in range(N):
        x[i], y[i] = map(int, input().split())

    if N == 1:
        print(1)
        sys.exit()

    vector = defaultdict(int)
    for a, b in combinations(range(N), 2):
        dx = x[a] - x[b]
        dy = y[a] - y[b]
        if dx == 0:
            vector[(0, abs(dy))] += 1
        elif dx > 0:
            vector[(dx, dy)] += 1
        else:
            vector[(-dx, -dy)] += 1

    ans = N - max(vector.values())
    print(ans)


if __name__ == "__main__":
    main() import sys sys from collections import defaultdict from itertools import combinations input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def main():
    N = int(input())
    x = [0] * N
    y = [0] * N
    for i in range(N):
        x[i], y[i] = map(int, input().split())

    if N == 1:
        print(1)
        sys.exit()

    vector = defaultdict(int)
    for a, b in combinations(range(N), 2):
        dx = x[a] - x[b]
        dy = y[a] - y[b]
        if dx == 0:
            vector[(0, abs(dy))] += 1
        elif dx > 0:
            vector[(dx, dy)] += 1
        else:
            vector[(-dx, -dy)] += 1

    ans = N - max(vector.values())
    print(ans) main N = int(input()) N int(input()) int input() input x = [0] * N x [0] * N [0] 0 N y = [0] * N y [0] * N [0] 0 N for i in range(N):
        x[i], y[i] = map(int, input().split())

     i range(N) range N x[i], y[i] = map(int, input().split()) x[i] x i map(int, input().split()) map int input().split() ().split () input split y[i] y i if N == 1:
        print(1)
        sys.exit()

     N == 1 N 1 print(1) print 1 sys.exit() sys.exit sys exit vector = defaultdict(int) vector defaultdict(int) defaultdict int for a, b in combinations(range(N), 2):
        dx = x[a] - x[b]
        dy = y[a] - y[b]
        if dx == 0:
            vector[(0, abs(dy))] += 1
        elif dx > 0:
            vector[(dx, dy)] += 1
        else:
            vector[(-dx, -dy)] += 1

     a b combinations(range(N), 2) combinations range(N) range N 2 dx = x[a] - x[b] dx x[a] - x[b] x[a] x a x[b] x b dy = y[a] - y[b] dy y[a] - y[b] y[a] y a y[b] y b if dx == 0:
            vector[(0, abs(dy))] += 1
        elif dx > 0:
            vector[(dx, dy)] += 1
        else:
            vector[(-dx, -dy)] += 1

     dx == 0 dx 0 vector[(0, abs(dy))] += 1 vector[(0, abs(dy))] vector (0, abs(dy)) 0 abs(dy) abs dy 1 elif dx > 0:
            vector[(dx, dy)] += 1
         dx > 0 dx 0 vector[(dx, dy)] += 1 vector[(dx, dy)] vector (dx, dy) dx dy 1 vector[(-dx, -dy)] += 1 vector[(-dx, -dy)] vector (-dx, -dy) -dx dx -dy dy 1 ans = N - max(vector.values()) ans N - max(vector.values()) N max(vector.values()) max vector.values() vector.values vector values print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N = int(input())
    x = [0] * N
    y = [0] * N
    for i in range(N):
        x[i], y[i] = map(int, input().split())

    if N == 1:
        print(1)
        sys.exit()

    vector = defaultdict(int)
    for a, b in combinations(range(N), 2):
        dx = x[a] - x[b]
        dy = y[a] - y[b]
        if dx == 0:
            vector[(0, abs(dy))] += 1
        elif dx > 0:
            vector[(dx, dy)] += 1
        else:
            vector[(-dx, -dy)] += 1

    ans = N - max(vector.values())
    print(ans) def main():
    N = int(input())
    x = [0] * N
    y = [0] * N
    for i in range(N):
        x[i], y[i] = map(int, input().split())

    if N == 1:
        print(1)
        sys.exit()

    vector = defaultdict(int)
    for a, b in combinations(range(N), 2):
        dx = x[a] - x[b]
        dy = y[a] - y[b]
        if dx == 0:
            vector[(0, abs(dy))] += 1
        elif dx > 0:
            vector[(dx, dy)] += 1
        else:
            vector[(-dx, -dy)] += 1

    ans = N - max(vector.values())
    print(ans) main input = sys.stdin.readline sys.stdin.readline input
import sys
from collections import defaultdict
from itertools import combinations

input = sys.stdin.readline


def main():
    N = int(input())
    x = [0] * N
    y = [0] * N
    for i in range(N):
        x[i], y[i] = map(int, input().split())

    if N == 1:
        print(1)
        sys.exit()

    vector = defaultdict(int)
    for a, b in combinations(range(N), 2):
        dx = x[a] - x[b]
        dy = y[a] - y[b]
        if dx == 0:
            vector[(0, abs(dy))] += 1
        elif dx > 0:
            vector[(dx, dy)] += 1
        else:
            vector[(-dx, -dy)] += 1

    ans = N - max(vector.values())
    print(ans)


if __name__ == "__main__":
    main()
