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 min = 0;
	for (int i = 0; i < N; i++) {
	    X[i] = sc.nextInt();
	    min += (X[i] - 1) * (X[i] - 1);
	}

	int count = 0;
	for (int i = 2; i < 101; i++) {
	    for (int j = 0; j < N; j++) {
		count += (X[j] - i) * (X[j] - i);
	    }

	    if (min > count)
		min = count;

	    count = 0;
	}

	System.out.println(min);
    }
} 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 min = 0;
	for (int i = 0; i < N; i++) {
	    X[i] = sc.nextInt();
	    min += (X[i] - 1) * (X[i] - 1);
	}

	int count = 0;
	for (int i = 2; i < 101; i++) {
	    for (int j = 0; j < N; j++) {
		count += (X[j] - i) * (X[j] - i);
	    }

	    if (min > count)
		min = count;

	    count = 0;
	}

	System.out.println(min);
    }
} Main public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);

	int N = sc.nextInt();
	int X[] = new int[N];
	int min = 0;
	for (int i = 0; i < N; i++) {
	    X[i] = sc.nextInt();
	    min += (X[i] - 1) * (X[i] - 1);
	}

	int count = 0;
	for (int i = 2; i < 101; i++) {
	    for (int j = 0; j < N; j++) {
		count += (X[j] - i) * (X[j] - i);
	    }

	    if (min > count)
		min = count;

	    count = 0;
	}

	System.out.println(min);
    } main {
	Scanner sc = new Scanner(System.in);

	int N = sc.nextInt();
	int X[] = new int[N];
	int min = 0;
	for (int i = 0; i < N; i++) {
	    X[i] = sc.nextInt();
	    min += (X[i] - 1) * (X[i] - 1);
	}

	int count = 0;
	for (int i = 2; i < 101; i++) {
	    for (int j = 0; j < N; j++) {
		count += (X[j] - i) * (X[j] - i);
	    }

	    if (min > count)
		min = count;

	    count = 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 X[] = new int[N]; X new int[N] N int min = 0; min 0 for (int i = 0; i < N; i++) {
	    X[i] = sc.nextInt();
	    min += (X[i] - 1) * (X[i] - 1);
	} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
	    X[i] = sc.nextInt();
	    min += (X[i] - 1) * (X[i] - 1);
	} {
	    X[i] = sc.nextInt();
	    min += (X[i] - 1) * (X[i] - 1);
	} X[i] = sc.nextInt() X[i] X i sc.nextInt() sc.nextInt sc min += (X[i] - 1) * (X[i] - 1) min (X[i] - 1) * (X[i] - 1) (X[i] - 1) X[i] X i 1 (X[i] - 1) X[i] X i 1 int count = 0; count 0 for (int i = 2; i < 101; i++) {
	    for (int j = 0; j < N; j++) {
		count += (X[j] - i) * (X[j] - i);
	    }

	    if (min > count)
		min = count;

	    count = 0;
	} int i = 2; int i = 2; i 2 i < 101 i 101 i++ i++ i {
	    for (int j = 0; j < N; j++) {
		count += (X[j] - i) * (X[j] - i);
	    }

	    if (min > count)
		min = count;

	    count = 0;
	} {
	    for (int j = 0; j < N; j++) {
		count += (X[j] - i) * (X[j] - i);
	    }

	    if (min > count)
		min = count;

	    count = 0;
	} for (int j = 0; j < N; j++) {
		count += (X[j] - i) * (X[j] - i);
	    } int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
		count += (X[j] - i) * (X[j] - i);
	    } {
		count += (X[j] - i) * (X[j] - i);
	    } count += (X[j] - i) * (X[j] - i) count (X[j] - i) * (X[j] - i) (X[j] - i) X[j] X j i (X[j] - i) X[j] X j i if (min > count)
		min = count; min > count min count min = count min count count = 0 count 0 System.out.println(min) System.out.println System.out System System.out min 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 min = 0;
	for (int i = 0; i < N; i++) {
	    X[i] = sc.nextInt();
	    min += (X[i] - 1) * (X[i] - 1);
	}

	int count = 0;
	for (int i = 2; i < 101; i++) {
	    for (int j = 0; j < N; j++) {
		count += (X[j] - i) * (X[j] - i);
	    }

	    if (min > count)
		min = count;

	    count = 0;
	}

	System.out.println(min);
    }
}