import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
	int n =  sc.nextInt();
	int[] x = new int[n];
	int sum = 0;
	int ans = Integer.MAX_VALUE;

	for(int i=0;i<n;i++) {
		x[i] = sc.nextInt();
	}

	for(int i=1;i<=100;i++) {
		for(int j=0;j<n;j++) {
			sum += (x[j]-i)*(x[j]-i);
		}
	ans = Math.min(sum, ans);
	sum = 0;
	}
	System.out.println(ans);
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
	int n =  sc.nextInt();
	int[] x = new int[n];
	int sum = 0;
	int ans = Integer.MAX_VALUE;

	for(int i=0;i<n;i++) {
		x[i] = sc.nextInt();
	}

	for(int i=1;i<=100;i++) {
		for(int j=0;j<n;j++) {
			sum += (x[j]-i)*(x[j]-i);
		}
	ans = Math.min(sum, ans);
	sum = 0;
	}
	System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
	int n =  sc.nextInt();
	int[] x = new int[n];
	int sum = 0;
	int ans = Integer.MAX_VALUE;

	for(int i=0;i<n;i++) {
		x[i] = sc.nextInt();
	}

	for(int i=1;i<=100;i++) {
		for(int j=0;j<n;j++) {
			sum += (x[j]-i)*(x[j]-i);
		}
	ans = Math.min(sum, ans);
	sum = 0;
	}
	System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
	int n =  sc.nextInt();
	int[] x = new int[n];
	int sum = 0;
	int ans = Integer.MAX_VALUE;

	for(int i=0;i<n;i++) {
		x[i] = sc.nextInt();
	}

	for(int i=1;i<=100;i++) {
		for(int j=0;j<n;j++) {
			sum += (x[j]-i)*(x[j]-i);
		}
	ans = Math.min(sum, ans);
	sum = 0;
	}
	System.out.println(ans);
  } 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 int sum = 0; sum 0 int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE 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 for(int i=1;i<=100;i++) {
		for(int j=0;j<n;j++) {
			sum += (x[j]-i)*(x[j]-i);
		}
	ans = Math.min(sum, ans);
	sum = 0;
	} int i=1; int i=1; i 1 i<=100 i 100 i++ i++ i {
		for(int j=0;j<n;j++) {
			sum += (x[j]-i)*(x[j]-i);
		}
	ans = Math.min(sum, ans);
	sum = 0;
	} {
		for(int j=0;j<n;j++) {
			sum += (x[j]-i)*(x[j]-i);
		}
	ans = Math.min(sum, ans);
	sum = 0;
	} for(int j=0;j<n;j++) {
			sum += (x[j]-i)*(x[j]-i);
		} int j=0; int j=0; j 0 j<n j n j++ j++ j {
			sum += (x[j]-i)*(x[j]-i);
		} {
			sum += (x[j]-i)*(x[j]-i);
		} sum += (x[j]-i)*(x[j]-i) sum (x[j]-i)*(x[j]-i) (x[j]-i) x[j] x j i (x[j]-i) x[j] x j i ans = Math.min(sum, ans) ans Math.min(sum, ans) Math.min Math sum ans sum = 0 sum 0 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
	int n =  sc.nextInt();
	int[] x = new int[n];
	int sum = 0;
	int ans = Integer.MAX_VALUE;

	for(int i=0;i<n;i++) {
		x[i] = sc.nextInt();
	}

	for(int i=1;i<=100;i++) {
		for(int j=0;j<n;j++) {
			sum += (x[j]-i)*(x[j]-i);
		}
	ans = Math.min(sum, ans);
	sum = 0;
	}
	System.out.println(ans);
  }
}