function main(input) {
  const inputs =input.split('\n')
  const [N] = inputs[0].split(' ').map(Number)
  const X = inputs[1].split(' ').map(Number)

  let min = Number.MAX_SAFE_INTEGER
  for (let i = 1; i <= 100; i++) {
    let sum = 0
    for (let j = 0; j < N; j++) {
      sum += Math.pow(X[j] - i, 2)
    }
    if (sum < min) min = sum
  }
  console.log(min)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
