import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
//		int n = sc.nextInt();
		int n = sc.nextInt();

		double[] dArray = new double[n];
		for(int i=0;i<n;i++) {
			dArray[i] = sc.nextDouble();
		}

		double ans = 0;

		for(int i=1;i<=100;i++) {
			double sum = 0;
			for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			}
			if(sum<ans || i==1) {
				ans = sum;
			}
		}

		System.out.println((int)ans);

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
//		int n = sc.nextInt();
		int n = sc.nextInt();

		double[] dArray = new double[n];
		for(int i=0;i<n;i++) {
			dArray[i] = sc.nextDouble();
		}

		double ans = 0;

		for(int i=1;i<=100;i++) {
			double sum = 0;
			for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			}
			if(sum<ans || i==1) {
				ans = sum;
			}
		}

		System.out.println((int)ans);

	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
//		int n = sc.nextInt();
		int n = sc.nextInt();

		double[] dArray = new double[n];
		for(int i=0;i<n;i++) {
			dArray[i] = sc.nextDouble();
		}

		double ans = 0;

		for(int i=1;i<=100;i++) {
			double sum = 0;
			for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			}
			if(sum<ans || i==1) {
				ans = sum;
			}
		}

		System.out.println((int)ans);

	} main {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
//		int n = sc.nextInt();
		int n = sc.nextInt();

		double[] dArray = new double[n];
		for(int i=0;i<n;i++) {
			dArray[i] = sc.nextDouble();
		}

		double ans = 0;

		for(int i=1;i<=100;i++) {
			double sum = 0;
			for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			}
			if(sum<ans || i==1) {
				ans = sum;
			}
		}

		System.out.println((int)ans);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc double[] dArray = new double[n]; dArray new double[n] n for(int i=0;i<n;i++) {
			dArray[i] = sc.nextDouble();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			dArray[i] = sc.nextDouble();
		} {
			dArray[i] = sc.nextDouble();
		} dArray[i] = sc.nextDouble() dArray[i] dArray i sc.nextDouble() sc.nextDouble sc double ans = 0; ans 0 for(int i=1;i<=100;i++) {
			double sum = 0;
			for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			}
			if(sum<ans || i==1) {
				ans = sum;
			}
		} int i=1; int i=1; i 1 i<=100 i 100 i++ i++ i {
			double sum = 0;
			for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			}
			if(sum<ans || i==1) {
				ans = sum;
			}
		} {
			double sum = 0;
			for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			}
			if(sum<ans || i==1) {
				ans = sum;
			}
		} double sum = 0; sum 0 for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			} int j=0; int j=0; j 0 j<n j n j++ j++ j {
				sum += Math.pow(dArray[j]-i, 2);
			} {
				sum += Math.pow(dArray[j]-i, 2);
			} sum += Math.pow(dArray[j]-i, 2) sum Math.pow(dArray[j]-i, 2) Math.pow Math dArray[j]-i dArray[j] dArray j i 2 if(sum<ans || i==1) {
				ans = sum;
			} sum<ans || i==1 sum<ans sum ans i==1 i 1 {
				ans = sum;
			} ans = sum ans sum System.out.println((int)ans) System.out.println System.out System System.out (int)ans String[] args args public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
//		int n = sc.nextInt();
		int n = sc.nextInt();

		double[] dArray = new double[n];
		for(int i=0;i<n;i++) {
			dArray[i] = sc.nextDouble();
		}

		double ans = 0;

		for(int i=1;i<=100;i++) {
			double sum = 0;
			for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			}
			if(sum<ans || i==1) {
				ans = sum;
			}
		}

		System.out.println((int)ans);

	}
} public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
//		int n = sc.nextInt();
		int n = sc.nextInt();

		double[] dArray = new double[n];
		for(int i=0;i<n;i++) {
			dArray[i] = sc.nextDouble();
		}

		double ans = 0;

		for(int i=1;i<=100;i++) {
			double sum = 0;
			for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			}
			if(sum<ans || i==1) {
				ans = sum;
			}
		}

		System.out.println((int)ans);

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
//		int n = sc.nextInt();
		int n = sc.nextInt();

		double[] dArray = new double[n];
		for(int i=0;i<n;i++) {
			dArray[i] = sc.nextDouble();
		}

		double ans = 0;

		for(int i=1;i<=100;i++) {
			double sum = 0;
			for(int j=0;j<n;j++) {
				sum += Math.pow(dArray[j]-i, 2);
			}
			if(sum<ans || i==1) {
				ans = sum;
			}
		}

		System.out.println((int)ans);

	}
}
