'use strict';

function main(stdin) {
  const input = stdin.split('\n')
  const N = input.shift();
  const pairs = input.map(c => c.split(' ').map(v => parseInt(v, 10)));
  const m = {};
  const r = [];
  const s = {};

  for (let i = 0, l = pairs.length; i < l; ++i) {
    r[i] = [];
    for (let j = 0; j < l; ++j) {
      if (i === j) continue;
      const p = pairs[j][0] - pairs[i][0];
      const q = pairs[j][1] - pairs[i][1];
      r[i][j] = [p, q];
      const key = [p, q].join(',');
      const c = m[key] || 0;
      m[key] = c + 1;

      s[key] = s[key] || [];
      s[key].push([i, j]);
    }
  }

  const keys = Object.keys(m);

  const sorted = keys.sort((a, b) => {
    return m[b] - m[a];
  });

  let best = 0;

  for (let i = 0, l = sorted.length; i < l; ++i) {
    function count(ary) {
      let c = 0;
      ary.forEach(a => ++c);
      return c;
    }

    const k = sorted[i];
    const max = m[k];
    const balls = s[k];

    const from = [];
    const to = [];

    balls.forEach(b => {
      from[b[0]] = true;
      to[b[1]] = true;
    });

    // 使える(p, q)の数
    // max - (max - from.length) - (max - to.length)
    const noCost = count(from) + count(to) - max;

    if (noCost > best) best = noCost;
    else break;
  }

  console.log(N - best);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));