import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int n = sc.nextInt();
			int[] xArray = new int[n];
			
			for(int i = 0 ; i < n ; i++ ) {
				xArray[i] = sc.nextInt();
			}
			
			int minE = Integer.MAX_VALUE;
			for(int i = 1 ; i <= 100 ; i++ ) {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			}
			
			System.out.println(minE);
			
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int n = sc.nextInt();
			int[] xArray = new int[n];
			
			for(int i = 0 ; i < n ; i++ ) {
				xArray[i] = sc.nextInt();
			}
			
			int minE = Integer.MAX_VALUE;
			for(int i = 1 ; i <= 100 ; i++ ) {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			}
			
			System.out.println(minE);
			
		}
	}
} Main public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int n = sc.nextInt();
			int[] xArray = new int[n];
			
			for(int i = 0 ; i < n ; i++ ) {
				xArray[i] = sc.nextInt();
			}
			
			int minE = Integer.MAX_VALUE;
			for(int i = 1 ; i <= 100 ; i++ ) {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			}
			
			System.out.println(minE);
			
		}
	} main {
		try(Scanner sc = new Scanner(System.in)) {
			
			int n = sc.nextInt();
			int[] xArray = new int[n];
			
			for(int i = 0 ; i < n ; i++ ) {
				xArray[i] = sc.nextInt();
			}
			
			int minE = Integer.MAX_VALUE;
			for(int i = 1 ; i <= 100 ; i++ ) {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			}
			
			System.out.println(minE);
			
		}
	} try(Scanner sc = new Scanner(System.in)) {
			
			int n = sc.nextInt();
			int[] xArray = new int[n];
			
			for(int i = 0 ; i < n ; i++ ) {
				xArray[i] = sc.nextInt();
			}
			
			int minE = Integer.MAX_VALUE;
			for(int i = 1 ; i <= 100 ; i++ ) {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			}
			
			System.out.println(minE);
			
		} {
			
			int n = sc.nextInt();
			int[] xArray = new int[n];
			
			for(int i = 0 ; i < n ; i++ ) {
				xArray[i] = sc.nextInt();
			}
			
			int minE = Integer.MAX_VALUE;
			for(int i = 1 ; i <= 100 ; i++ ) {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			}
			
			System.out.println(minE);
			
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] xArray = new int[n]; xArray new int[n] n for(int i = 0 ; i < n ; i++ ) {
				xArray[i] = sc.nextInt();
			} int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
				xArray[i] = sc.nextInt();
			} {
				xArray[i] = sc.nextInt();
			} xArray[i] = sc.nextInt() xArray[i] xArray i sc.nextInt() sc.nextInt sc int minE = Integer.MAX_VALUE; minE Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 1 ; i <= 100 ; i++ ) {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			} int i = 1 ; int i = 1 ; i 1 i <= 100 i 100 i++ i++ i {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			} {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			} int e = 0; e 0 for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				} int j = 0 ; int j = 0 ; j 0 j < n j n j++ j++ j {
					e += (int)Math.pow(xArray[j] - i, 2);
				} {
					e += (int)Math.pow(xArray[j] - i, 2);
				} e += (int)Math.pow(xArray[j] - i, 2) e (int)Math.pow(xArray[j] - i, 2) Math.pow Math xArray[j] - i xArray[j] xArray j i 2 if ( e < minE ) {
					minE = e;
				} e < minE e minE {
					minE = e;
				} minE = e minE e System.out.println(minE) System.out.println System.out System System.out minE String[] args args public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int n = sc.nextInt();
			int[] xArray = new int[n];
			
			for(int i = 0 ; i < n ; i++ ) {
				xArray[i] = sc.nextInt();
			}
			
			int minE = Integer.MAX_VALUE;
			for(int i = 1 ; i <= 100 ; i++ ) {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			}
			
			System.out.println(minE);
			
		}
	}
} public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int n = sc.nextInt();
			int[] xArray = new int[n];
			
			for(int i = 0 ; i < n ; i++ ) {
				xArray[i] = sc.nextInt();
			}
			
			int minE = Integer.MAX_VALUE;
			for(int i = 1 ; i <= 100 ; i++ ) {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			}
			
			System.out.println(minE);
			
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int n = sc.nextInt();
			int[] xArray = new int[n];
			
			for(int i = 0 ; i < n ; i++ ) {
				xArray[i] = sc.nextInt();
			}
			
			int minE = Integer.MAX_VALUE;
			for(int i = 1 ; i <= 100 ; i++ ) {
				
				int e = 0;
				for(int j = 0 ; j < n ; j++ ) {
					e += (int)Math.pow(xArray[j] - i, 2);
				}
				if ( e < minE ) {
					minE = e;
				}
			}
			
			System.out.println(minE);
			
		}
	}
}