import java.util.Scanner;
 

//result = Math.pow(num1, num3)
//StringBuffer str = new StringBuffer(hoge1);
//String hoge2 = str.reverse().toString();
public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	//static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	
	
	public static void main(String[] args) {
	int N =sc.nextInt();
	int x[]=new int[N];
	for(int i=0;i<N;i++) {
		x[i]=sc.nextInt();
	}
	int least=0;
	int hp;
	for(int p=1;p<=100;p++) {
		hp=0;
		for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		}
		if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		}
	}
	p(least);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	//static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	
	
	public static void main(String[] args) {
	int N =sc.nextInt();
	int x[]=new int[N];
	for(int i=0;i<N;i++) {
		x[i]=sc.nextInt();
	}
	int least=0;
	int hp;
	for(int p=1;p<=100;p++) {
		hp=0;
		for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		}
		if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		}
	}
	p(least);
	}
} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static void p(String ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans String ans ans static void p(int ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans int ans ans static void p(long ans) {System.out.println(ans);} p {System.out.println(ans);} System.out.println(ans) System.out.println System.out System System.out ans long ans ans public static void main(String[] args) {
	int N =sc.nextInt();
	int x[]=new int[N];
	for(int i=0;i<N;i++) {
		x[i]=sc.nextInt();
	}
	int least=0;
	int hp;
	for(int p=1;p<=100;p++) {
		hp=0;
		for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		}
		if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		}
	}
	p(least);
	} main {
	int N =sc.nextInt();
	int x[]=new int[N];
	for(int i=0;i<N;i++) {
		x[i]=sc.nextInt();
	}
	int least=0;
	int hp;
	for(int p=1;p<=100;p++) {
		hp=0;
		for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		}
		if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		}
	}
	p(least);
	} int N =sc.nextInt(); N sc.nextInt() sc.nextInt sc int x[]=new int[N]; x new int[N] N for(int i=0;i<N;i++) {
		x[i]=sc.nextInt();
	} int i=0; int i=0; i 0 i<N i N i++ i++ i {
		x[i]=sc.nextInt();
	} {
		x[i]=sc.nextInt();
	} x[i]=sc.nextInt() x[i] x i sc.nextInt() sc.nextInt sc int least=0; least 0 int hp; hp for(int p=1;p<=100;p++) {
		hp=0;
		for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		}
		if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		}
	} int p=1; int p=1; p 1 p<=100 p 100 p++ p++ p {
		hp=0;
		for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		}
		if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		}
	} {
		hp=0;
		for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		}
		if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		}
	} hp=0 hp 0 for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		} int a=0; int a=0; a 0 a<N a N a++ a++ a {
			hp+=(x[a]-p)*(x[a]-p);
		} {
			hp+=(x[a]-p)*(x[a]-p);
		} hp+=(x[a]-p)*(x[a]-p) hp (x[a]-p)*(x[a]-p) (x[a]-p) x[a] x a p (x[a]-p) x[a] x a p if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		} p==1 p 1 {
			least=hp;
		} least=hp least hp if(least>hp) {
		least=hp;
		} least>hp least hp {
		least=hp;
		} least=hp least hp p(least) p least String[] args args public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	//static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	
	
	public static void main(String[] args) {
	int N =sc.nextInt();
	int x[]=new int[N];
	for(int i=0;i<N;i++) {
		x[i]=sc.nextInt();
	}
	int least=0;
	int hp;
	for(int p=1;p<=100;p++) {
		hp=0;
		for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		}
		if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		}
	}
	p(least);
	}
} public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	//static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	
	
	public static void main(String[] args) {
	int N =sc.nextInt();
	int x[]=new int[N];
	for(int i=0;i<N;i++) {
		x[i]=sc.nextInt();
	}
	int least=0;
	int hp;
	for(int p=1;p<=100;p++) {
		hp=0;
		for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		}
		if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		}
	}
	p(least);
	}
} Main
import java.util.Scanner;
 

//result = Math.pow(num1, num3)
//StringBuffer str = new StringBuffer(hoge1);
//String hoge2 = str.reverse().toString();
public class Main {
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	//static String eikomoji[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
	
	
	public static void main(String[] args) {
	int N =sc.nextInt();
	int x[]=new int[N];
	for(int i=0;i<N;i++) {
		x[i]=sc.nextInt();
	}
	int least=0;
	int hp;
	for(int p=1;p<=100;p++) {
		hp=0;
		for(int a=0;a<N;a++) {
			hp+=(x[a]-p)*(x[a]-p);
		}
		if(p==1) {
			least=hp;
		}else if(least>hp) {
		least=hp;
		}
	}
	p(least);
	}
}