

function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  input.shift();
  var xy = input.map(i => i.split(" ").map(i => parseInt(i)));
  xy.splice(N,xy.length-N);
  xy.sort(function(a,b){
    if (a[0] < b[0]) return -1;
    if (a[0] > b[0]) return 1;
    return 0;
  })
  var cnt=[];
  var max=0;
  for(var i=1;i<N;i++){
    var xsub=xy[i][0]-xy[i-1][0];
    var ysub=xy[i][1]-xy[i-1][1];
    if(cnt[xsub]==undefined){
      cnt[xsub]=[];
      cnt[xsub][ysub]=1;
      max=Math.max(max,1);
    }else{
      if(cnt[xsub][ysub]==undefined){
        cnt[xsub][ysub]=1;
        max=Math.max(max,1);
      }else{
        cnt[xsub][ysub]++;
        max=Math.max(max,cnt[xsub][ysub]);
      }
    }
  }

  xy.sort(function(a,b){
    if (a[1] < b[1]) return -1;
    if (a[1] > b[1]) return 1;
    return 0;

  })

  var cnt=[];
  for(var i=1;i<N;i++){
    var xsub=xy[i][0]-xy[i-1][0];
    var ysub=xy[i][1]-xy[i-1][1];
    if(cnt[xsub]==undefined){
      cnt[xsub]=[];
      cnt[xsub][ysub]=1;
      max=Math.max(max,1);
    }else{
      if(cnt[xsub][ysub]==undefined){
        cnt[xsub][ysub]=1;
        max=Math.max(max,1);
      }else{
        cnt[xsub][ysub]++;
        max=Math.max(max,cnt[xsub][ysub]);
      }
    }
  }
  var ans=1+N-max-1;
  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));