import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int N;
        int[] Xi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Xi = new int[N];
            for (int i = 0; i < N; i++) {
                Xi[i] = sc.nextInt();
            }
        }

        int result = Integer.MAX_VALUE;
        for (int i = 0; i < 101; i++) {
            int temp = 0;
            for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            }
            if(result > temp){
                result = temp;
            }
        }

        System.out.println(result);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        int N;
        int[] Xi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Xi = new int[N];
            for (int i = 0; i < N; i++) {
                Xi[i] = sc.nextInt();
            }
        }

        int result = Integer.MAX_VALUE;
        for (int i = 0; i < 101; i++) {
            int temp = 0;
            for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            }
            if(result > temp){
                result = temp;
            }
        }

        System.out.println(result);
    }
} Main public static void main(String[] args) {
        int N;
        int[] Xi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Xi = new int[N];
            for (int i = 0; i < N; i++) {
                Xi[i] = sc.nextInt();
            }
        }

        int result = Integer.MAX_VALUE;
        for (int i = 0; i < 101; i++) {
            int temp = 0;
            for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            }
            if(result > temp){
                result = temp;
            }
        }

        System.out.println(result);
    } main {
        int N;
        int[] Xi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Xi = new int[N];
            for (int i = 0; i < N; i++) {
                Xi[i] = sc.nextInt();
            }
        }

        int result = Integer.MAX_VALUE;
        for (int i = 0; i < 101; i++) {
            int temp = 0;
            for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            }
            if(result > temp){
                result = temp;
            }
        }

        System.out.println(result);
    } int N; N int[] Xi = null; Xi null try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Xi = new int[N];
            for (int i = 0; i < N; i++) {
                Xi[i] = sc.nextInt();
            }
        } {
            N = sc.nextInt();
            Xi = new int[N];
            for (int i = 0; i < N; i++) {
                Xi[i] = sc.nextInt();
            }
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc Xi = new int[N] Xi new int[N] N for (int i = 0; i < N; i++) {
                Xi[i] = sc.nextInt();
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                Xi[i] = sc.nextInt();
            } {
                Xi[i] = sc.nextInt();
            } Xi[i] = sc.nextInt() Xi[i] Xi i sc.nextInt() sc.nextInt sc int result = Integer.MAX_VALUE; result Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i < 101; i++) {
            int temp = 0;
            for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            }
            if(result > temp){
                result = temp;
            }
        } int i = 0; int i = 0; i 0 i < 101 i 101 i++ i++ i {
            int temp = 0;
            for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            }
            if(result > temp){
                result = temp;
            }
        } {
            int temp = 0;
            for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            }
            if(result > temp){
                result = temp;
            }
        } int temp = 0; temp 0 for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            } int j Xi {
                temp += Math.pow(Math.abs(i - j),2);
            } {
                temp += Math.pow(Math.abs(i - j),2);
            } temp += Math.pow(Math.abs(i - j),2) temp Math.pow(Math.abs(i - j),2) Math.pow Math Math.abs(i - j) Math.abs Math i - j i j 2 if(result > temp){
                result = temp;
            } result > temp result temp {
                result = temp;
            } result = temp result temp System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        int N;
        int[] Xi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Xi = new int[N];
            for (int i = 0; i < N; i++) {
                Xi[i] = sc.nextInt();
            }
        }

        int result = Integer.MAX_VALUE;
        for (int i = 0; i < 101; i++) {
            int temp = 0;
            for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            }
            if(result > temp){
                result = temp;
            }
        }

        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        int N;
        int[] Xi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Xi = new int[N];
            for (int i = 0; i < N; i++) {
                Xi[i] = sc.nextInt();
            }
        }

        int result = Integer.MAX_VALUE;
        for (int i = 0; i < 101; i++) {
            int temp = 0;
            for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            }
            if(result > temp){
                result = temp;
            }
        }

        System.out.println(result);
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int N;
        int[] Xi = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Xi = new int[N];
            for (int i = 0; i < N; i++) {
                Xi[i] = sc.nextInt();
            }
        }

        int result = Integer.MAX_VALUE;
        for (int i = 0; i < 101; i++) {
            int temp = 0;
            for(int j : Xi){
                temp += Math.pow(Math.abs(i - j),2);
            }
            if(result > temp){
                result = temp;
            }
        }

        System.out.println(result);
    }
}
