import 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+1];
		for(int i=1;i<=N;i++){
			X[i]=sc.nextInt();
		}
		int Max = Integer.MIN_VALUE;
		int Low = Integer.MAX_VALUE;
		int HP = 0;
		for(int i=1;i<=100;i++){
			HP=0;
			for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			}
			if (Max < HP) {Max=HP;
			}
			if (Low > HP) {Low=HP;
			}
		}
		System.out.println(Low);
        }
    } import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X[]=new int[N+1];
		for(int i=1;i<=N;i++){
			X[i]=sc.nextInt();
		}
		int Max = Integer.MIN_VALUE;
		int Low = Integer.MAX_VALUE;
		int HP = 0;
		for(int i=1;i<=100;i++){
			HP=0;
			for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			}
			if (Max < HP) {Max=HP;
			}
			if (Low > HP) {Low=HP;
			}
		}
		System.out.println(Low);
        }
    } Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X[]=new int[N+1];
		for(int i=1;i<=N;i++){
			X[i]=sc.nextInt();
		}
		int Max = Integer.MIN_VALUE;
		int Low = Integer.MAX_VALUE;
		int HP = 0;
		for(int i=1;i<=100;i++){
			HP=0;
			for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			}
			if (Max < HP) {Max=HP;
			}
			if (Low > HP) {Low=HP;
			}
		}
		System.out.println(Low);
        } main {
        Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X[]=new int[N+1];
		for(int i=1;i<=N;i++){
			X[i]=sc.nextInt();
		}
		int Max = Integer.MIN_VALUE;
		int Low = Integer.MAX_VALUE;
		int HP = 0;
		for(int i=1;i<=100;i++){
			HP=0;
			for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			}
			if (Max < HP) {Max=HP;
			}
			if (Low > HP) {Low=HP;
			}
		}
		System.out.println(Low);
        } 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+1]; X new int[N+1] N+1 N 1 for(int i=1;i<=N;i++){
			X[i]=sc.nextInt();
		} int i=1; int i=1; i 1 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 Max = Integer.MIN_VALUE; Max Integer.MIN_VALUE Integer Integer.MIN_VALUE int Low = Integer.MAX_VALUE; Low Integer.MAX_VALUE Integer Integer.MAX_VALUE int HP = 0; HP 0 for(int i=1;i<=100;i++){
			HP=0;
			for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			}
			if (Max < HP) {Max=HP;
			}
			if (Low > HP) {Low=HP;
			}
		} int i=1; int i=1; i 1 i<=100 i 100 i++ i++ i {
			HP=0;
			for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			}
			if (Max < HP) {Max=HP;
			}
			if (Low > HP) {Low=HP;
			}
		} {
			HP=0;
			for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			}
			if (Max < HP) {Max=HP;
			}
			if (Low > HP) {Low=HP;
			}
		} HP=0 HP 0 for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			} int j=1; int j=1; j 1 j<=N j N j++ j++ j {
				HP=HP+(i-X[j])*(i-X[j]);
			} {
				HP=HP+(i-X[j])*(i-X[j]);
			} HP=HP+(i-X[j])*(i-X[j]) HP HP+(i-X[j])*(i-X[j]) HP (i-X[j])*(i-X[j]) (i-X[j]) i X[j] X j (i-X[j]) i X[j] X j if (Max < HP) {Max=HP;
			} Max < HP Max HP {Max=HP;
			} Max=HP Max HP if (Low > HP) {Low=HP;
			} Low > HP Low HP {Low=HP;
			} Low=HP Low HP System.out.println(Low) System.out.println System.out System System.out Low 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+1];
		for(int i=1;i<=N;i++){
			X[i]=sc.nextInt();
		}
		int Max = Integer.MIN_VALUE;
		int Low = Integer.MAX_VALUE;
		int HP = 0;
		for(int i=1;i<=100;i++){
			HP=0;
			for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			}
			if (Max < HP) {Max=HP;
			}
			if (Low > HP) {Low=HP;
			}
		}
		System.out.println(Low);
        }
    } public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X[]=new int[N+1];
		for(int i=1;i<=N;i++){
			X[i]=sc.nextInt();
		}
		int Max = Integer.MIN_VALUE;
		int Low = Integer.MAX_VALUE;
		int HP = 0;
		for(int i=1;i<=100;i++){
			HP=0;
			for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			}
			if (Max < HP) {Max=HP;
			}
			if (Low > HP) {Low=HP;
			}
		}
		System.out.println(Low);
        }
    } Main
import 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+1];
		for(int i=1;i<=N;i++){
			X[i]=sc.nextInt();
		}
		int Max = Integer.MIN_VALUE;
		int Low = Integer.MAX_VALUE;
		int HP = 0;
		for(int i=1;i<=100;i++){
			HP=0;
			for(int j=1;j<=N;j++){
				HP=HP+(i-X[j])*(i-X[j]);
			}
			if (Max < HP) {Max=HP;
			}
			if (Low > HP) {Low=HP;
			}
		}
		System.out.println(Low);
        }
    }