import java.util.Scanner;

public class Main {

	public static int N;
	public static int[] X;

	public static void main(String[] args) {
		init();
		int min = 100 * 100 * 100;
		for (int p = 1; p <= 100; p++) {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			}
			if (sum < min) {
				min = sum;
			}
		}
		System.out.println(min);
	}

	public static void init() {
		Scanner sc = new Scanner(System.in);
		try {
			N = sc.nextInt();
			X = new int[N];
			for (int i = 0; i < N; i++) {
				X[i] = sc.nextInt();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static int N;
	public static int[] X;

	public static void main(String[] args) {
		init();
		int min = 100 * 100 * 100;
		for (int p = 1; p <= 100; p++) {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			}
			if (sum < min) {
				min = sum;
			}
		}
		System.out.println(min);
	}

	public static void init() {
		Scanner sc = new Scanner(System.in);
		try {
			N = sc.nextInt();
			X = new int[N];
			for (int i = 0; i < N; i++) {
				X[i] = sc.nextInt();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} Main public static int N; N public static int[] X; X public static void main(String[] args) {
		init();
		int min = 100 * 100 * 100;
		for (int p = 1; p <= 100; p++) {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			}
			if (sum < min) {
				min = sum;
			}
		}
		System.out.println(min);
	} main {
		init();
		int min = 100 * 100 * 100;
		for (int p = 1; p <= 100; p++) {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			}
			if (sum < min) {
				min = sum;
			}
		}
		System.out.println(min);
	} init() init int min = 100 * 100 * 100; min 100 * 100 * 100 100 * 100 * 100 100 100 100 for (int p = 1; p <= 100; p++) {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			}
			if (sum < min) {
				min = sum;
			}
		} int p = 1; int p = 1; p 1 p <= 100 p 100 p++ p++ p {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			}
			if (sum < min) {
				min = sum;
			}
		} {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			}
			if (sum < min) {
				min = sum;
			}
		} int sum = 0; sum 0 for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
				sum += (X[i] - p) * (X[i] - p);
			} {
				sum += (X[i] - p) * (X[i] - p);
			} sum += (X[i] - p) * (X[i] - p) sum (X[i] - p) * (X[i] - p) (X[i] - p) X[i] X i p (X[i] - p) X[i] X i p if (sum < min) {
				min = sum;
			} sum < min sum min {
				min = sum;
			} min = sum min sum System.out.println(min) System.out.println System.out System System.out min String[] args args public static void init() {
		Scanner sc = new Scanner(System.in);
		try {
			N = sc.nextInt();
			X = new int[N];
			for (int i = 0; i < N; i++) {
				X[i] = sc.nextInt();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	} init {
		Scanner sc = new Scanner(System.in);
		try {
			N = sc.nextInt();
			X = new int[N];
			for (int i = 0; i < N; i++) {
				X[i] = sc.nextInt();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) try {
			N = sc.nextInt();
			X = new int[N];
			for (int i = 0; i < N; i++) {
				X[i] = sc.nextInt();
			}
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			N = sc.nextInt();
			X = new int[N];
			for (int i = 0; i < N; i++) {
				X[i] = sc.nextInt();
			}
		} N = sc.nextInt() N sc.nextInt() sc.nextInt sc 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 public class Main {

	public static int N;
	public static int[] X;

	public static void main(String[] args) {
		init();
		int min = 100 * 100 * 100;
		for (int p = 1; p <= 100; p++) {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			}
			if (sum < min) {
				min = sum;
			}
		}
		System.out.println(min);
	}

	public static void init() {
		Scanner sc = new Scanner(System.in);
		try {
			N = sc.nextInt();
			X = new int[N];
			for (int i = 0; i < N; i++) {
				X[i] = sc.nextInt();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} public class Main {

	public static int N;
	public static int[] X;

	public static void main(String[] args) {
		init();
		int min = 100 * 100 * 100;
		for (int p = 1; p <= 100; p++) {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			}
			if (sum < min) {
				min = sum;
			}
		}
		System.out.println(min);
	}

	public static void init() {
		Scanner sc = new Scanner(System.in);
		try {
			N = sc.nextInt();
			X = new int[N];
			for (int i = 0; i < N; i++) {
				X[i] = sc.nextInt();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static int N;
	public static int[] X;

	public static void main(String[] args) {
		init();
		int min = 100 * 100 * 100;
		for (int p = 1; p <= 100; p++) {
			int sum = 0;
			for (int i = 0; i < N; i++) {
				sum += (X[i] - p) * (X[i] - p);
			}
			if (sum < min) {
				min = sum;
			}
		}
		System.out.println(min);
	}

	public static void init() {
		Scanner sc = new Scanner(System.in);
		try {
			N = sc.nextInt();
			X = new int[N];
			for (int i = 0; i < N; i++) {
				X[i] = sc.nextInt();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
