local n = io.read("*n")
local x = {}
for i = 1, n do
  x[i] = io.read("*n")
end
local r = 1000000007
local mmi, mma = math.min, math.max
for i = 1, 100 do
  local c = 0
  for j = 1, n do
    c = c + (x[j] - i) * (x[j] - i)
  end
  r = mmi(r, c)
end
print(r)
