import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val x = (1..n).map { sc.nextInt() }
    var ans = Int.MAX_VALUE
    for (p in 1..100) {
        ans = Math.min(ans, x.map { (it - p) * (it - p) }.sum())
    }
    println(ans)
}
