import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int sum = 0;
		int[] x = new int[n];
		for (int i = 0; i < n; i++) {
			int j = kb.nextInt();
			x[i] = j;
		}

		for (int j = 1; j <= 100; j++) {
			int sum2 = 0;
			for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			}
			if (j == 1)
				sum = sum2;
			if (sum > sum2)
				sum = sum2;
		}
		System.out.println(sum);
		kb.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int sum = 0;
		int[] x = new int[n];
		for (int i = 0; i < n; i++) {
			int j = kb.nextInt();
			x[i] = j;
		}

		for (int j = 1; j <= 100; j++) {
			int sum2 = 0;
			for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			}
			if (j == 1)
				sum = sum2;
			if (sum > sum2)
				sum = sum2;
		}
		System.out.println(sum);
		kb.close();
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int sum = 0;
		int[] x = new int[n];
		for (int i = 0; i < n; i++) {
			int j = kb.nextInt();
			x[i] = j;
		}

		for (int j = 1; j <= 100; j++) {
			int sum2 = 0;
			for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			}
			if (j == 1)
				sum = sum2;
			if (sum > sum2)
				sum = sum2;
		}
		System.out.println(sum);
		kb.close();
	} main {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int sum = 0;
		int[] x = new int[n];
		for (int i = 0; i < n; i++) {
			int j = kb.nextInt();
			x[i] = j;
		}

		for (int j = 1; j <= 100; j++) {
			int sum2 = 0;
			for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			}
			if (j == 1)
				sum = sum2;
			if (sum > sum2)
				sum = sum2;
		}
		System.out.println(sum);
		kb.close();
	} Scanner kb = new Scanner(System.in); kb new Scanner(System.in) int n = kb.nextInt(); n kb.nextInt() kb.nextInt kb int sum = 0; sum 0 int[] x = new int[n]; x new int[n] n for (int i = 0; i < n; i++) {
			int j = kb.nextInt();
			x[i] = j;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int j = kb.nextInt();
			x[i] = j;
		} {
			int j = kb.nextInt();
			x[i] = j;
		} int j = kb.nextInt(); j kb.nextInt() kb.nextInt kb x[i] = j x[i] x i j for (int j = 1; j <= 100; j++) {
			int sum2 = 0;
			for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			}
			if (j == 1)
				sum = sum2;
			if (sum > sum2)
				sum = sum2;
		} int j = 1; int j = 1; j 1 j <= 100 j 100 j++ j++ j {
			int sum2 = 0;
			for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			}
			if (j == 1)
				sum = sum2;
			if (sum > sum2)
				sum = sum2;
		} {
			int sum2 = 0;
			for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			}
			if (j == 1)
				sum = sum2;
			if (sum > sum2)
				sum = sum2;
		} int sum2 = 0; sum2 0 for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				sum2 += (int) Math.pow(x[i] - j, 2);
			} {
				sum2 += (int) Math.pow(x[i] - j, 2);
			} sum2 += (int) Math.pow(x[i] - j, 2) sum2 (int) Math.pow(x[i] - j, 2) Math.pow Math x[i] - j x[i] x i j 2 if (j == 1)
				sum = sum2; j == 1 j 1 sum = sum2 sum sum2 if (sum > sum2)
				sum = sum2; sum > sum2 sum sum2 sum = sum2 sum sum2 System.out.println(sum) System.out.println System.out System System.out sum kb.close() kb.close kb String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int sum = 0;
		int[] x = new int[n];
		for (int i = 0; i < n; i++) {
			int j = kb.nextInt();
			x[i] = j;
		}

		for (int j = 1; j <= 100; j++) {
			int sum2 = 0;
			for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			}
			if (j == 1)
				sum = sum2;
			if (sum > sum2)
				sum = sum2;
		}
		System.out.println(sum);
		kb.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int sum = 0;
		int[] x = new int[n];
		for (int i = 0; i < n; i++) {
			int j = kb.nextInt();
			x[i] = j;
		}

		for (int j = 1; j <= 100; j++) {
			int sum2 = 0;
			for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			}
			if (j == 1)
				sum = sum2;
			if (sum > sum2)
				sum = sum2;
		}
		System.out.println(sum);
		kb.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int sum = 0;
		int[] x = new int[n];
		for (int i = 0; i < n; i++) {
			int j = kb.nextInt();
			x[i] = j;
		}

		for (int j = 1; j <= 100; j++) {
			int sum2 = 0;
			for (int i = 0; i < n; i++) {
				sum2 += (int) Math.pow(x[i] - j, 2);
			}
			if (j == 1)
				sum = sum2;
			if (sum > sum2)
				sum = sum2;
		}
		System.out.println(sum);
		kb.close();
	}

}
