import scala.io.{StdIn => in}
import scala.collection.{mutable => mu}

object Main extends App {
  import MapHelper._

  val n = in.readInt
  val pb = Iterator.continually(in.readLine)
    .take(n)
    .map(_.split(" ").map(_.toLong))
    .toArray
  val px = pb.map(e => e(0)).sorted(Ordering[Long].reverse)
  val py = pb.map(e => e(1)).sorted(Ordering[Long].reverse)
  val mapX = mu.HashMap.empty[Long,Long]
  val mapY = mu.HashMap.empty[Long,Long]

  for(i <- 0 until n-1) {
    mapX.addOrUpdate(px(i) - px(i+1),1)
  }
  val mX = if(n == 1) (0L -> 0L) else mapX.maxBy(m => m._2)
  // println(mX)
  for(i <- 0 until n-1) {
    mapY.addOrUpdate(py(i) - py(i+1),1)
  }
  val mY = if(n == 1) (0L -> 0L) else mapY.maxBy(m => m._2)
  // println(mY)

  val mapZ = mu.HashMap.empty[Long,Long]
  val spb = if(mX._2 > mY._2) {
    pb.sortWith((x, y) => {
      if(x(0) != y(0)) {
        x(0) > y(0)
      } else {
        x(1) > y(1)
      }
    })
  } else {
    pb.sortWith((x, y) => {
      if(x(1) != y(1)) {
        x(1) > y(1)
      } else {
        x(0) > y(0)
      }
    })
  }

  val mZ = if(n == 1) (0L -> 0L)
    else if(mX._2 > mY._2) {
    for(i <- 0 until n-1) {
      val v = spb(i)(0) - spb(i+1)(0)
      if(v == mX._1)
        mapZ.addOrUpdate(spb(i)(1)- spb(i+1)(1),1)
    }
    if(mapZ.isEmpty) (0L -> 0L) else mapZ.maxBy(_._2)
  } else {
    for(i <- 0 until n-1) {
      val v = spb(i)(1) - spb(i+1)(1)
      if(v == mY._1)
        mapZ.addOrUpdate(spb(i)(0)- spb(i+1)(0),1)
    }
    if(mapZ.isEmpty) (0L -> 0L) else mapZ.maxBy(_._2)
  }
  // println(mZ)

  val t = if(mX._2 == mY._2) mX._2 else mZ._2

  val ans = math.max(1, n - t)
  println(ans)

  object MapHelper {
    implicit class AddOrUpdate[A](map:mu.HashMap[Long,Long]) {
      def addOrUpdate(key:Long, value:Long):mu.HashMap[Long,Long] =
      {
        if(map.contains(key)) map(key) += value
        else map += (key -> value)
        map
      }
    }
  }
}