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.sortWith((x, y) => {
      if(x(0) != y(0)) {
        x(0) > y(0)
      } else {
        x(1) > y(1)
      }
    })
  val py = pb.sortWith((x, y) => {
      if(x(1) != y(1)) {
        x(1) > y(1)
      } else {
        x(0) > y(0)
      }
    })
  val mapX = mu.HashMap.empty[(Long,Long),Long]
  val mapY = mu.HashMap.empty[(Long,Long),Long]

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

  val t = mX max mY

  val ans = n - t
  println(ans)

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