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-1;i++){
            x[i]=sc.nextInt();
        }
        int ans=10000000;
        for(int c=1;c<=100;c++){
            int total=0;
            for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            }
            if(total<ans){
                ans=total;
            }
        }
        System.out.println(ans);
    }

} 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-1;i++){
            x[i]=sc.nextInt();
        }
        int ans=10000000;
        for(int c=1;c<=100;c++){
            int total=0;
            for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            }
            if(total<ans){
                ans=total;
            }
        }
        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];
        for (int i=0;i<=n-1;i++){
            x[i]=sc.nextInt();
        }
        int ans=10000000;
        for(int c=1;c<=100;c++){
            int total=0;
            for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            }
            if(total<ans){
                ans=total;
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int[] x=new int[n];
        for (int i=0;i<=n-1;i++){
            x[i]=sc.nextInt();
        }
        int ans=10000000;
        for(int c=1;c<=100;c++){
            int total=0;
            for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            }
            if(total<ans){
                ans=total;
            }
        }
        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 for (int i=0;i<=n-1;i++){
            x[i]=sc.nextInt();
        } int i=0; int i=0; i 0 i<=n-1 i n-1 n 1 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 c=1;c<=100;c++){
            int total=0;
            for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            }
            if(total<ans){
                ans=total;
            }
        } int c=1; int c=1; c 1 c<=100 c 100 c++ c++ c {
            int total=0;
            for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            }
            if(total<ans){
                ans=total;
            }
        } {
            int total=0;
            for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            }
            if(total<ans){
                ans=total;
            }
        } int total=0; total 0 for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            } int i=0; int i=0; i 0 i<=n-1 i n-1 n 1 i++ i++ i {
                total+=(x[i]-c)*(x[i]-c);
            } {
                total+=(x[i]-c)*(x[i]-c);
            } total+=(x[i]-c)*(x[i]-c) total (x[i]-c)*(x[i]-c) (x[i]-c) x[i] x i c (x[i]-c) x[i] x i c if(total<ans){
                ans=total;
            } total<ans total ans {
                ans=total;
            } ans=total ans total 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){
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int[] x=new int[n];
        for (int i=0;i<=n-1;i++){
            x[i]=sc.nextInt();
        }
        int ans=10000000;
        for(int c=1;c<=100;c++){
            int total=0;
            for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            }
            if(total<ans){
                ans=total;
            }
        }
        System.out.println(ans);
    }

} 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-1;i++){
            x[i]=sc.nextInt();
        }
        int ans=10000000;
        for(int c=1;c<=100;c++){
            int total=0;
            for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            }
            if(total<ans){
                ans=total;
            }
        }
        System.out.println(ans);
    }

} 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-1;i++){
            x[i]=sc.nextInt();
        }
        int ans=10000000;
        for(int c=1;c<=100;c++){
            int total=0;
            for(int i=0;i<=n-1;i++){
                total+=(x[i]-c)*(x[i]-c);
            }
            if(total<ans){
                ans=total;
            }
        }
        System.out.println(ans);
    }

}
