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];
        int hsum = 0;
        int min = 0;

        for(int i=0; i<N; i++){
            X[i] = sc.nextInt();
        }
        for(int i=1; i<=100; i++){
            for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            }
            if(i==1){
                min = hsum;
            }
            min = Math.min(min, hsum);
            hsum = 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];
        int hsum = 0;
        int min = 0;

        for(int i=0; i<N; i++){
            X[i] = sc.nextInt();
        }
        for(int i=1; i<=100; i++){
            for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            }
            if(i==1){
                min = hsum;
            }
            min = Math.min(min, hsum);
            hsum = 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 hsum = 0;
        int min = 0;

        for(int i=0; i<N; i++){
            X[i] = sc.nextInt();
        }
        for(int i=1; i<=100; i++){
            for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            }
            if(i==1){
                min = hsum;
            }
            min = Math.min(min, hsum);
            hsum = 0;
        }
        System.out.println(min);
    } main {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int[] X = new int[N];
        int hsum = 0;
        int min = 0;

        for(int i=0; i<N; i++){
            X[i] = sc.nextInt();
        }
        for(int i=1; i<=100; i++){
            for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            }
            if(i==1){
                min = hsum;
            }
            min = Math.min(min, hsum);
            hsum = 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 hsum = 0; hsum 0 int min = 0; min 0 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 for(int i=1; i<=100; i++){
            for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            }
            if(i==1){
                min = hsum;
            }
            min = Math.min(min, hsum);
            hsum = 0;
        } int i=1; int i=1; i 1 i<=100 i 100 i++ i++ i {
            for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            }
            if(i==1){
                min = hsum;
            }
            min = Math.min(min, hsum);
            hsum = 0;
        } {
            for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            }
            if(i==1){
                min = hsum;
            }
            min = Math.min(min, hsum);
            hsum = 0;
        } for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            } int j=0; int j=0; j 0 j<N j N j++ j++ j {
                hsum += Math.pow((X[j] - i), 2);
            } {
                hsum += Math.pow((X[j] - i), 2);
            } hsum += Math.pow((X[j] - i), 2) hsum Math.pow((X[j] - i), 2) Math.pow Math (X[j] - i) X[j] X j i 2 if(i==1){
                min = hsum;
            } i==1 i 1 {
                min = hsum;
            } min = hsum min hsum min = Math.min(min, hsum) min Math.min(min, hsum) Math.min Math min hsum hsum = 0 hsum 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];
        int hsum = 0;
        int min = 0;

        for(int i=0; i<N; i++){
            X[i] = sc.nextInt();
        }
        for(int i=1; i<=100; i++){
            for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            }
            if(i==1){
                min = hsum;
            }
            min = Math.min(min, hsum);
            hsum = 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];
        int hsum = 0;
        int min = 0;

        for(int i=0; i<N; i++){
            X[i] = sc.nextInt();
        }
        for(int i=1; i<=100; i++){
            for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            }
            if(i==1){
                min = hsum;
            }
            min = Math.min(min, hsum);
            hsum = 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];
        int hsum = 0;
        int min = 0;

        for(int i=0; i<N; i++){
            X[i] = sc.nextInt();
        }
        for(int i=1; i<=100; i++){
            for(int j=0; j<N; j++){
                hsum += Math.pow((X[j] - i), 2);
            }
            if(i==1){
                min = hsum;
            }
            min = Math.min(min, hsum);
            hsum = 0;
        }
        System.out.println(min);
    }
}