import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int sum = 0;
		int min = Integer.MAX_VALUE;
		List<Integer> intList = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			intList.add(sc.nextInt());
		}

		for (int index = 1; index <= 100; index++) {
			for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			}
			if (sum < min) {
				min = sum;
			}
			sum = 0;
		}

		System.out.println(min);
	}

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util 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 sum = 0;
		int min = Integer.MAX_VALUE;
		List<Integer> intList = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			intList.add(sc.nextInt());
		}

		for (int index = 1; index <= 100; index++) {
			for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			}
			if (sum < min) {
				min = sum;
			}
			sum = 0;
		}

		System.out.println(min);
	}

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

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int sum = 0;
		int min = Integer.MAX_VALUE;
		List<Integer> intList = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			intList.add(sc.nextInt());
		}

		for (int index = 1; index <= 100; index++) {
			for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			}
			if (sum < min) {
				min = sum;
			}
			sum = 0;
		}

		System.out.println(min);
	} main {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int sum = 0;
		int min = Integer.MAX_VALUE;
		List<Integer> intList = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			intList.add(sc.nextInt());
		}

		for (int index = 1; index <= 100; index++) {
			for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			}
			if (sum < min) {
				min = sum;
			}
			sum = 0;
		}

		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 sum = 0; sum 0 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE List<Integer> intList = new ArrayList<>(); intList new ArrayList<>() for (int i = 0; i < n; i++) {
			intList.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			intList.add(sc.nextInt());
		} {
			intList.add(sc.nextInt());
		} intList.add(sc.nextInt()) intList.add intList sc.nextInt() sc.nextInt sc for (int index = 1; index <= 100; index++) {
			for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			}
			if (sum < min) {
				min = sum;
			}
			sum = 0;
		} int index = 1; int index = 1; index 1 index <= 100 index 100 index++ index++ index {
			for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			}
			if (sum < min) {
				min = sum;
			}
			sum = 0;
		} {
			for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			}
			if (sum < min) {
				min = sum;
			}
			sum = 0;
		} for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			} int j = 0; int j = 0; j 0 j < intList.size() j intList.size() intList.size intList j++ j++ j {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			} {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			} int hp = (intList.get(j) - index) * (intList.get(j) - index); hp (intList.get(j) - index) * (intList.get(j) - index) (intList.get(j) - index) intList.get(j) intList.get intList j index (intList.get(j) - index) intList.get(j) intList.get intList j index sum = sum + hp sum sum + hp sum hp if (sum < min) {
				min = sum;
			} sum < min sum min {
				min = sum;
			} min = sum min sum sum = 0 sum 0 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 sum = 0;
		int min = Integer.MAX_VALUE;
		List<Integer> intList = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			intList.add(sc.nextInt());
		}

		for (int index = 1; index <= 100; index++) {
			for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			}
			if (sum < min) {
				min = sum;
			}
			sum = 0;
		}

		System.out.println(min);
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int sum = 0;
		int min = Integer.MAX_VALUE;
		List<Integer> intList = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			intList.add(sc.nextInt());
		}

		for (int index = 1; index <= 100; index++) {
			for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			}
			if (sum < min) {
				min = sum;
			}
			sum = 0;
		}

		System.out.println(min);
	}

} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int sum = 0;
		int min = Integer.MAX_VALUE;
		List<Integer> intList = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			intList.add(sc.nextInt());
		}

		for (int index = 1; index <= 100; index++) {
			for (int j = 0; j < intList.size(); j++) {
				int hp = (intList.get(j) - index) * (intList.get(j) - index);
				sum = sum + hp;
			}
			if (sum < min) {
				min = sum;
			}
			sum = 0;
		}

		System.out.println(min);
	}

}