import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		for(int i = 0;i<n;i++) {
			x[i] = sc.nextInt();
		}
		int min =1000000;
		for(int i=0;i<=100;i++) {
			int temp = 0;
			for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			}
			min = Math.min(min, temp);
		}
		System.out.println(min);
	}

} 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[] x = new int[n];
		for(int i = 0;i<n;i++) {
			x[i] = sc.nextInt();
		}
		int min =1000000;
		for(int i=0;i<=100;i++) {
			int temp = 0;
			for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			}
			min = Math.min(min, temp);
		}
		System.out.println(min);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		for(int i = 0;i<n;i++) {
			x[i] = sc.nextInt();
		}
		int min =1000000;
		for(int i=0;i<=100;i++) {
			int temp = 0;
			for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			}
			min = Math.min(min, temp);
		}
		System.out.println(min);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		for(int i = 0;i<n;i++) {
			x[i] = sc.nextInt();
		}
		int min =1000000;
		for(int i=0;i<=100;i++) {
			int temp = 0;
			for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			}
			min = Math.min(min, temp);
		}
		System.out.println(min);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) 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 min =1000000; min 1000000 for(int i=0;i<=100;i++) {
			int temp = 0;
			for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			}
			min = Math.min(min, temp);
		} int i=0; int i=0; i 0 i<=100 i 100 i++ i++ i {
			int temp = 0;
			for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			}
			min = Math.min(min, temp);
		} {
			int temp = 0;
			for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			}
			min = Math.min(min, temp);
		} int temp = 0; temp 0 for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			} int j=0; int j=0; j 0 j<n j n j++ j++ j {
				temp += Math.pow(x[j]-i, 2);
			} {
				temp += Math.pow(x[j]-i, 2);
			} temp += Math.pow(x[j]-i, 2) temp Math.pow(x[j]-i, 2) Math.pow Math x[j]-i x[j] x j i 2 min = Math.min(min, temp) min Math.min(min, temp) Math.min Math min temp System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		for(int i = 0;i<n;i++) {
			x[i] = sc.nextInt();
		}
		int min =1000000;
		for(int i=0;i<=100;i++) {
			int temp = 0;
			for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			}
			min = Math.min(min, temp);
		}
		System.out.println(min);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		for(int i = 0;i<n;i++) {
			x[i] = sc.nextInt();
		}
		int min =1000000;
		for(int i=0;i<=100;i++) {
			int temp = 0;
			for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			}
			min = Math.min(min, temp);
		}
		System.out.println(min);
	}

} 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[] x = new int[n];
		for(int i = 0;i<n;i++) {
			x[i] = sc.nextInt();
		}
		int min =1000000;
		for(int i=0;i<=100;i++) {
			int temp = 0;
			for(int j=0;j<n;j++) {
				temp += Math.pow(x[j]-i, 2);
			}
			min = Math.min(min, temp);
		}
		System.out.println(min);
	}

}
