import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] junin = new int[n];
		for(int i =0;i < n;i++) {
			junin[i] = sc.nextInt();
		}
		int answerKoho = 0;
		int answer = 0;
		for(int i = 1;i <= 100;i++) {
			for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			}
			if(answerKoho < answer) {
				answer = answerKoho;
			}
			if(i ==1) {
				answer = answerKoho;
			}
			answerKoho = 0;
		}
		System.out.println(answer);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] junin = new int[n];
		for(int i =0;i < n;i++) {
			junin[i] = sc.nextInt();
		}
		int answerKoho = 0;
		int answer = 0;
		for(int i = 1;i <= 100;i++) {
			for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			}
			if(answerKoho < answer) {
				answer = answerKoho;
			}
			if(i ==1) {
				answer = answerKoho;
			}
			answerKoho = 0;
		}
		System.out.println(answer);
	}
} Main public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] junin = new int[n];
		for(int i =0;i < n;i++) {
			junin[i] = sc.nextInt();
		}
		int answerKoho = 0;
		int answer = 0;
		for(int i = 1;i <= 100;i++) {
			for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			}
			if(answerKoho < answer) {
				answer = answerKoho;
			}
			if(i ==1) {
				answer = answerKoho;
			}
			answerKoho = 0;
		}
		System.out.println(answer);
	} main {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] junin = new int[n];
		for(int i =0;i < n;i++) {
			junin[i] = sc.nextInt();
		}
		int answerKoho = 0;
		int answer = 0;
		for(int i = 1;i <= 100;i++) {
			for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			}
			if(answerKoho < answer) {
				answer = answerKoho;
			}
			if(i ==1) {
				answer = answerKoho;
			}
			answerKoho = 0;
		}
		System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] junin = new int[n]; junin new int[n] n for(int i =0;i < n;i++) {
			junin[i] = sc.nextInt();
		} int i =0; int i =0; i 0 i < n i n i++ i++ i {
			junin[i] = sc.nextInt();
		} {
			junin[i] = sc.nextInt();
		} junin[i] = sc.nextInt() junin[i] junin i sc.nextInt() sc.nextInt sc int answerKoho = 0; answerKoho 0 int answer = 0; answer 0 for(int i = 1;i <= 100;i++) {
			for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			}
			if(answerKoho < answer) {
				answer = answerKoho;
			}
			if(i ==1) {
				answer = answerKoho;
			}
			answerKoho = 0;
		} int i = 1; int i = 1; i 1 i <= 100 i 100 i++ i++ i {
			for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			}
			if(answerKoho < answer) {
				answer = answerKoho;
			}
			if(i ==1) {
				answer = answerKoho;
			}
			answerKoho = 0;
		} {
			for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			}
			if(answerKoho < answer) {
				answer = answerKoho;
			}
			if(i ==1) {
				answer = answerKoho;
			}
			answerKoho = 0;
		} for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			} int j =0; int j =0; j 0 j < n j n j++ j++ j {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			} {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			} answerKoho += (junin[j] -i) * (junin[j] -i) answerKoho (junin[j] -i) * (junin[j] -i) (junin[j] -i) junin[j] junin j i (junin[j] -i) junin[j] junin j i if(answerKoho < answer) {
				answer = answerKoho;
			} answerKoho < answer answerKoho answer {
				answer = answerKoho;
			} answer = answerKoho answer answerKoho if(i ==1) {
				answer = answerKoho;
			} i ==1 i 1 {
				answer = answerKoho;
			} answer = answerKoho answer answerKoho answerKoho = 0 answerKoho 0 System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] junin = new int[n];
		for(int i =0;i < n;i++) {
			junin[i] = sc.nextInt();
		}
		int answerKoho = 0;
		int answer = 0;
		for(int i = 1;i <= 100;i++) {
			for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			}
			if(answerKoho < answer) {
				answer = answerKoho;
			}
			if(i ==1) {
				answer = answerKoho;
			}
			answerKoho = 0;
		}
		System.out.println(answer);
	}
} public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] junin = new int[n];
		for(int i =0;i < n;i++) {
			junin[i] = sc.nextInt();
		}
		int answerKoho = 0;
		int answer = 0;
		for(int i = 1;i <= 100;i++) {
			for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			}
			if(answerKoho < answer) {
				answer = answerKoho;
			}
			if(i ==1) {
				answer = answerKoho;
			}
			answerKoho = 0;
		}
		System.out.println(answer);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] junin = new int[n];
		for(int i =0;i < n;i++) {
			junin[i] = sc.nextInt();
		}
		int answerKoho = 0;
		int answer = 0;
		for(int i = 1;i <= 100;i++) {
			for(int j =0;j < n;j++) {
				answerKoho += (junin[j] -i) * (junin[j] -i);
			}
			if(answerKoho < answer) {
				answer = answerKoho;
			}
			if(i ==1) {
				answer = answerKoho;
			}
			answerKoho = 0;
		}
		System.out.println(answer);
	}
}