program diverta2019_2_b
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,i,j,p,q,cost
    integer(int32), allocatable:: x(:), y(:)
    logical,allocatable:: u(:)

    read*, n
    allocate(x(n), y(n), u(n))

    do i=1,n
        read*, x(i), y(i)
    end do
    cost = 1000
    do i=1,n
        do j=1,n
            if (j==i) cycle
            p = x(j)-x(i)
            q = y(j)-y(i)
            u(:) = .false.
            cost = min(cost, n-calc_cost(p,q))
        end do
    end do
    print'(i0)', cost
contains
    recursive function calc_cost(p,q) result(ret)
        integer(int32):: p,q,ret
        integer(int32):: i,j
        ret = 0
        do i=1,n
            do j=1,n
                if (x(j)-x(i) == p .and. y(j)-y(i) == q) ret=ret+1
            end do
        end do
    end function
end program diverta2019_2_b