import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        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 ans = 10000000;
        for (int i = 0 ; i <= 100 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            ans = Math.min(ans, sum);
        }
        System.out.println(ans);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        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 ans = 10000000;
        for (int i = 0 ; i <= 100 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            ans = Math.min(ans, sum);
        }
        System.out.println(ans);
    }

} Main public static void main(String[] args) {
        @SuppressWarnings("resource")
        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 ans = 10000000;
        for (int i = 0 ; i <= 100 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            ans = Math.min(ans, sum);
        }
        System.out.println(ans);
    } main {
        @SuppressWarnings("resource")
        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 ans = 10000000;
        for (int i = 0 ; i <= 100 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            ans = Math.min(ans, sum);
        }
        System.out.println(ans);
    } @SuppressWarnings("resource")
        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 ans = 10000000; ans 10000000 for (int i = 0 ; i <= 100 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            ans = Math.min(ans, sum);
        } int i = 0 ; int i = 0 ; i 0 i <= 100 i 100 i++ i++ i {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            ans = Math.min(ans, sum);
        } {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            ans = Math.min(ans, sum);
        } int sum = 0; 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(ans, sum) ans Math.min(ans, sum) Math.min Math ans sum System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        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 ans = 10000000;
        for (int i = 0 ; i <= 100 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            ans = Math.min(ans, sum);
        }
        System.out.println(ans);
    }

} public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        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 ans = 10000000;
        for (int i = 0 ; i <= 100 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            ans = Math.min(ans, sum);
        }
        System.out.println(ans);
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        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 ans = 10000000;
        for (int i = 0 ; i <= 100 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < n ; j++) {
                sum += (x[j] - i) * (x[j] - i);
            }
            ans = Math.min(ans, sum);
        }
        System.out.println(ans);
    }

}