fun main(args: Array<String>) = abc156c()

fun abc156c() {
    val n = readLine()!!.toInt()
    val xList = readLine()!!.split(' ').map { it.toLong() }

    var answer = Long.MAX_VALUE / 10

    for (i in 1..100) {
        val sum = xList.map { (i - it) * (i - it) }.sum()
        answer = Math.min(answer, sum)
    }

    println(answer)
}
