import std.stdio, std.string, std.conv;
import std.math, std.algorithm;

void main(){
	auto N = readInput!()();
	auto X = readInput!()();
	
	auto point = (X.maxElement()+X.minElement())/2 ;
	
	//size_t sum;
	size_t[] list;
	
	foreach( i ; 1..100 ){
		list ~= X.map!( x => (x-i)^^2 ).sum();
	}
	list.minElement().writeln();
	
	return;
}

T[] readInput( T = size_t )(){
	T[] ol;
	foreach( string elm ; readln().chomp().split() ){
		ol ~= elm.to!T();
	}
	return ol;
}

