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];
        for (int i =0;  i < n; i++ ) {
            x[i] = sc.nextInt();
        }
        int sum = 0;
        int min = 0;
        for (int p =1; p<= 100; p++){
            for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            }
            if (p == 1){
                min = sum;
            } else if (sum < min) {
                min = sum;
            }
            sum = 0;
        }
        System.out.println(min);
    }
} 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];
        for (int i =0;  i < n; i++ ) {
            x[i] = sc.nextInt();
        }
        int sum = 0;
        int min = 0;
        for (int p =1; p<= 100; p++){
            for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            }
            if (p == 1){
                min = sum;
            } else 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[] x = new int[n];
        for (int i =0;  i < n; i++ ) {
            x[i] = sc.nextInt();
        }
        int sum = 0;
        int min = 0;
        for (int p =1; p<= 100; p++){
            for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            }
            if (p == 1){
                min = sum;
            } else if (sum < min) {
                min = sum;
            }
            sum = 0;
        }
        System.out.println(min);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] x = new int[n];
        for (int i =0;  i < n; i++ ) {
            x[i] = sc.nextInt();
        }
        int sum = 0;
        int min = 0;
        for (int p =1; p<= 100; p++){
            for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            }
            if (p == 1){
                min = sum;
            } else 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[] x = new int[n]; x new int[n] n 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 int sum = 0; sum 0 int min = 0; min 0 for (int p =1; p<= 100; p++){
            for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            }
            if (p == 1){
                min = sum;
            } else if (sum < min) {
                min = sum;
            }
            sum = 0;
        } int p =1; int p =1; p 1 p<= 100 p 100 p++ p++ p {
            for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            }
            if (p == 1){
                min = sum;
            } else if (sum < min) {
                min = sum;
            }
            sum = 0;
        } {
            for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            }
            if (p == 1){
                min = sum;
            } else if (sum < min) {
                min = sum;
            }
            sum = 0;
        } for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            } int i = 0; int i = 0; i 0 i< n i n i++ i++ i {
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            } {
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            } sum = (int) (sum + Math.pow(x[i] - p, 2)) sum (int) (sum + Math.pow(x[i] - p, 2)) sum Math.pow(x[i] - p, 2) Math.pow Math x[i] - p x[i] x i p 2 if (p == 1){
                min = sum;
            } else if (sum < min) {
                min = sum;
            } p == 1 p 1 {
                min = sum;
            } min = sum min sum 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[] x = new int[n];
        for (int i =0;  i < n; i++ ) {
            x[i] = sc.nextInt();
        }
        int sum = 0;
        int min = 0;
        for (int p =1; p<= 100; p++){
            for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            }
            if (p == 1){
                min = sum;
            } else 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[] x = new int[n];
        for (int i =0;  i < n; i++ ) {
            x[i] = sc.nextInt();
        }
        int sum = 0;
        int min = 0;
        for (int p =1; p<= 100; p++){
            for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            }
            if (p == 1){
                min = sum;
            } else if (sum < min) {
                min = sum;
            }
            sum = 0;
        }
        System.out.println(min);
    }
} 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];
        for (int i =0;  i < n; i++ ) {
            x[i] = sc.nextInt();
        }
        int sum = 0;
        int min = 0;
        for (int p =1; p<= 100; p++){
            for (int i = 0; i< n; i++){
                sum = (int) (sum + Math.pow(x[i] - p, 2));
            }
            if (p == 1){
                min = sum;
            } else if (sum < min) {
                min = sum;
            }
            sum = 0;
        }
        System.out.println(min);
    }
}
