#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <limits>
#include <list>
#include <cassert>
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define pint_INF 2000000000
#define ll_INF 	9223372036854775807
#define MOD 1000000007
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvll vector<vector<long long>>
#define vvc vector<vector<char>>
#define vll vector<long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define sysp system("PAUSE")
#define pno cout << "no" << endl
#define pyes cout << "yes" << endl
#define pYes cout << "Yes" << endl
#define pNo cout << "No" << endl
#define pNO cout << "NO" << endl
#define pYES cout << "YES" << endl
#define endl "\n"
#define pi 3.14159265358979
using namespace std;
using ll = long long;
#define int ll

template<typename T>
vector<T> operator+(const vector<T>& lhs, const vector<T>& rhs) {
    assert(lhs.size() == rhs.size());
    vector<T> res(lhs.size());
    for (int i = 0; i < lhs.size(); i++) {
        res[i] = lhs[i] + rhs[i];
    }
    return res;
}

template<typename T>
vector<T> operator-(const vector<T>& lhs, const vector<T>& rhs) {
    assert(lhs.size() == rhs.size());
    vector<T> res(lhs.size());
    for (int i = 0; i < lhs.size(); i++) {
        res[i] = lhs[i] - rhs[i];
    }
    return res;
}

void miniDFS(int start, vector<bool>& isVisited, const vvi& vec, const vi& unit) {
    isVisited[start] = true;
    for (int i = 0; i < isVisited.size(); i++) {
        if (!isVisited[i]) {
            vi v1 = vec[start] - vec[i];
            vi v2 = vec[i] - vec[start];
            if (v1 == unit || v2 == unit) {
                miniDFS(i, isVisited, vec, unit);
            }
        }
    }
}

signed main() {
    int N; cin >> N;
    vvi vec(N, vi(2));
    rep(i, N) {
        int x, y; cin >> x >> y;
        vec[i] = { x,y };
    }
    map<vi, int> mp;
    for (int i = 0; i < N - 1; i++) {
        for (int j = i+1 ; j < N; j++) {
            vi dif = { vec[i][0] - vec[j][0],vec[i][1] - vec[j][1] };
            mp[dif] += 1;
        }
    }

    vector<int> unit;
    int A = 1e10;
    for (auto iter = mp.begin(); iter != mp.end(); iter++) {
        unit = iter->first;
        vector<bool> isVisited(N, false);
        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (!isVisited[i]) {
                miniDFS(i, isVisited, vec, unit);
                ans++;
            }
        }
        A = min(A, ans);
    }
    if (N == 1) A = 1;
    cout << A << endl;
}

Measured memory_bytes: 3752