fun main(args: Array<String>) {
    val (N) = readLine()!!.split(" "). map { it.toInt() }
    val X = readLine()!!.split(" "). map { it.toInt() }
    var min = Integer.MAX_VALUE
    for (i in 1 .. 100) {
        var vit = 0
        X.forEach {
            vit += (it - i) * (it - i)
        }
        min = Math.min(min, vit)
    }
    println(min)
}