import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] x = new int[n];
        long count = 1000000000000000000l;
        for (int i=0;i<n;i++){
            x[i] = scanner.nextInt();
        }
        for (int i=0;i<100;i++){
            int instance = 0;
            for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            }
            if (count>instance){
                count = instance;
            }
        }
        System.out.println(count);

    }

} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] x = new int[n];
        long count = 1000000000000000000l;
        for (int i=0;i<n;i++){
            x[i] = scanner.nextInt();
        }
        for (int i=0;i<100;i++){
            int instance = 0;
            for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            }
            if (count>instance){
                count = instance;
            }
        }
        System.out.println(count);

    }

} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] x = new int[n];
        long count = 1000000000000000000l;
        for (int i=0;i<n;i++){
            x[i] = scanner.nextInt();
        }
        for (int i=0;i<100;i++){
            int instance = 0;
            for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            }
            if (count>instance){
                count = instance;
            }
        }
        System.out.println(count);

    } main {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] x = new int[n];
        long count = 1000000000000000000l;
        for (int i=0;i<n;i++){
            x[i] = scanner.nextInt();
        }
        for (int i=0;i<100;i++){
            int instance = 0;
            for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            }
            if (count>instance){
                count = instance;
            }
        }
        System.out.println(count);

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int[] x = new int[n]; x new int[n] n long count = 1000000000000000000l; count 1000000000000000000l for (int i=0;i<n;i++){
            x[i] = scanner.nextInt();
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            x[i] = scanner.nextInt();
        } {
            x[i] = scanner.nextInt();
        } x[i] = scanner.nextInt() x[i] x i scanner.nextInt() scanner.nextInt scanner for (int i=0;i<100;i++){
            int instance = 0;
            for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            }
            if (count>instance){
                count = instance;
            }
        } int i=0; int i=0; i 0 i<100 i 100 i++ i++ i {
            int instance = 0;
            for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            }
            if (count>instance){
                count = instance;
            }
        } {
            int instance = 0;
            for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            }
            if (count>instance){
                count = instance;
            }
        } int instance = 0; instance 0 for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            } int j=0; int j=0; j 0 j<n j n j++ j++ j {
                instance += (x[j]-i)*(x[j]-i);
            } {
                instance += (x[j]-i)*(x[j]-i);
            } instance += (x[j]-i)*(x[j]-i) instance (x[j]-i)*(x[j]-i) (x[j]-i) x[j] x j i (x[j]-i) x[j] x j i if (count>instance){
                count = instance;
            } count>instance count instance {
                count = instance;
            } count = instance count instance System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] x = new int[n];
        long count = 1000000000000000000l;
        for (int i=0;i<n;i++){
            x[i] = scanner.nextInt();
        }
        for (int i=0;i<100;i++){
            int instance = 0;
            for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            }
            if (count>instance){
                count = instance;
            }
        }
        System.out.println(count);

    }

} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] x = new int[n];
        long count = 1000000000000000000l;
        for (int i=0;i<n;i++){
            x[i] = scanner.nextInt();
        }
        for (int i=0;i<100;i++){
            int instance = 0;
            for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            }
            if (count>instance){
                count = instance;
            }
        }
        System.out.println(count);

    }

} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] x = new int[n];
        long count = 1000000000000000000l;
        for (int i=0;i<n;i++){
            x[i] = scanner.nextInt();
        }
        for (int i=0;i<100;i++){
            int instance = 0;
            for (int j=0;j<n;j++){
                instance += (x[j]-i)*(x[j]-i);
            }
            if (count>instance){
                count = instance;
            }
        }
        System.out.println(count);

    }

}