'use strict'

function Main(input) {
  input = input.trim().split('\n')
  const N = parseInt(input[0])
  let X = input[1].split(' ').map(s => parseInt(s))

  X = X.sort()

  const MAX = 100



  let result = Infinity

  for(let i = 1; i <= MAX; ++i) {
    let total = 0
    for(let j = 0; j < N; ++j) {
      const n = X[j] - i
      total += n * n
    }

    result = Math.min(result, total)
  }

  if( result === Infinity ) result = 1
  console.log(result)


}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
