import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

import scala.annotation.tailrec

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val out = new PrintWriter(new BufferedOutputStream(System.out))
    val _ = in.readLine().toInt
    val xs = in.readLine().split("\\s+").map(_.toInt)

    out.println(
      (1 to 100).map { p =>
        xs.map { x => (x - p) * (x - p) }.sum
      }.min
    )

    out.flush()
  }
}
