object Main extends App {

  import scala.io.StdIn._
  import scala.math._
  val n = readLine.trim.toInt
  val planets = Array.tabulate(n){_ ⇒
    val Array(x, y) = readLine.trim.split(' ').map(_.toInt.toRational)
    Coordinate(x, y)
  }
  println(
    planets.tail.permutations.map{p ⇒ minLine(p.toList, planets.head)}.min
  )
  def minLine(planets: List[Coordinate], start: Coordinate): Int = {
    def sub(planets: List[Coordinate], current: Coordinate, lines: List[Line]): Int = {
      planets match {
        case Nil ⇒ lines.length
        case h::t ⇒
          val line = verticalHalf(current, h)
          if (lines.contains(line)) sub(t, h, lines)
          else sub(t, h, line::lines)
      }
    }
    sub(planets, start, Nil)
  }

  def verticalHalf(a: Coordinate, b: Coordinate): Line = {
    val mid = a + b match {case Coordinate(x, y) ⇒ Coordinate(x / 2.toRational, y / 2.toRational)}
    val diff = a - b  match {case Coordinate(x, y) ⇒ Coordinate(-y, x)}
    new Line(mid, mid + diff)
  }
  class Line(private val from: Coordinate, private val to: Coordinate){
    override def toString: String = s"Line($from, $to)"
    private def dx: Rational = (to - from).x
    private def dy: Rational = (to - from).y
    def isOnLine(point: Coordinate): Boolean = {
      point - from match {
        case Coordinate(x, y) ⇒
          val ddx = dx
          val ddy = dy
          ddx * y == ddy * x
      }
    }
    override def equals(obj: Any): Boolean = {
      obj match {
        case line: Line ⇒ isOnLine(line.from) && isOnLine(line.to)
        case _ ⇒ super.equals(obj)
      }
    }
  }
  object Rational{
    def apply(numerator: Long, denominator: Long): Rational = {
      val g = gcd(math.abs(numerator), math.abs(denominator))
      val signum = numerator.signum * denominator.signum
      new Rational(signum * math.abs(numerator / g), math.abs(denominator / g))
    }
    private def gcd(a: Long, b: Long): Long = {
      b match {
        case 0l ⇒ a
        case _ ⇒ gcd(b, a % b)
      }
    }
  }
  implicit class ToRational(val value: Int){
    def toRational: Rational = Rational(value, 1)
  }
  class Rational private (private val numerator: Long, private val denominator: Long) extends Ordered[Rational] {
    def +(that: Rational): Rational = Rational(numerator * that.denominator + denominator * that.numerator, denominator * that.denominator)
    def -(that: Rational): Rational = Rational(numerator * that.denominator - denominator * that.numerator, denominator * that.denominator)
    def *(that: Rational): Rational = Rational(numerator * that.numerator, denominator * that.denominator)
    def /(that: Rational): Rational = Rational(numerator * that.denominator, denominator * that.numerator)
    def unary_-(): Rational = Rational(-numerator, denominator)
    override def compare(that: Rational): Int = (this - that).numerator.compare(0)

    override def equals(obj: Any): Boolean = {
      obj match {
        case r: Rational ⇒ this.compare(r) == 0
        case _ ⇒ super.equals(obj)
      }
    }
    override def toString: String = s"$numerator / $denominator"
  }
  case class Coordinate(x: Rational, y: Rational){
    def -(that: Coordinate): Coordinate = Coordinate(x - that.x, y - that.y)
    def +(that: Coordinate): Coordinate = Coordinate(x + that.x, y + that.y)
  }
  implicit class Extension[T](val value :T){
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
    def let[R](func: T ⇒ R): R = func(value)
  }
}
