fun main(args: Array<String>) {

    val n = readLine()!!.toInt()
    val x = readLine()!!.split(" ").map { it.toInt() }
    val ar = Array<Int>(100){0}

    for(i in 0 until 100) {
        var a = 0
        for(j in x) {
            a += (j - (i+1)) * (j - (i+1))
        }
        ar[i] = a
    }

    println(ar.min())

}