object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val N = sc.nextInt()
    val P: IndexedSeq[(Long, Long)] =
      (0 until N) map { _ =>
        val x, y = sc.nextLong()
        (x, y)
      }

    if (P.size == 1)
      println(0)
    else {
      val cost0 = P.sliding(2).map { slide =>
        val bp = slide(0)
        val np = slide(1)
        val (bx, by) = bp
        val (nx, ny) = np
        (nx - bx, ny - by)
      }. toList. groupBy(identity). mapValues(_.size). values. max
      println(N - cost0)
    }
  }

}
