import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] x = new int[n];
        for(int i = 0; i < n; i++) x[i] = scan.nextInt();
        int out = Integer.MAX_VALUE;
        for(int i = 1; i <= 100; i++){
            int sum = 0;
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            if(out > sum) out = sum;
        }
        System.out.println(out);
        scan.close();
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] x = new int[n];
        for(int i = 0; i < n; i++) x[i] = scan.nextInt();
        int out = Integer.MAX_VALUE;
        for(int i = 1; i <= 100; i++){
            int sum = 0;
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            if(out > sum) out = sum;
        }
        System.out.println(out);
        scan.close();
    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] x = new int[n];
        for(int i = 0; i < n; i++) x[i] = scan.nextInt();
        int out = Integer.MAX_VALUE;
        for(int i = 1; i <= 100; i++){
            int sum = 0;
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            if(out > sum) out = sum;
        }
        System.out.println(out);
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] x = new int[n];
        for(int i = 0; i < n; i++) x[i] = scan.nextInt();
        int out = Integer.MAX_VALUE;
        for(int i = 1; i <= 100; i++){
            int sum = 0;
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            if(out > sum) out = sum;
        }
        System.out.println(out);
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] x = new int[n]; x new int[n] n for(int i = 0; i < n; i++) x[i] = scan.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i x[i] = scan.nextInt(); x[i] = scan.nextInt() x[i] x i scan.nextInt() scan.nextInt scan int out = Integer.MAX_VALUE; out Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 1; i <= 100; i++){
            int sum = 0;
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            if(out > sum) out = sum;
        } int i = 1; int i = 1; i 1 i <= 100 i 100 i++ i++ i {
            int sum = 0;
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            if(out > sum) out = sum;
        } {
            int sum = 0;
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            if(out > sum) out = sum;
        } int sum = 0; sum 0 for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                sum += Math.pow(x[j] - i, 2);
            } {
                sum += Math.pow(x[j] - i, 2);
            } sum += Math.pow(x[j] - i, 2) sum Math.pow(x[j] - i, 2) Math.pow Math x[j] - i x[j] x j i 2 if(out > sum) out = sum; out > sum out sum out = sum out sum System.out.println(out) System.out.println System.out System System.out out scan.close() scan.close scan String[] args args public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] x = new int[n];
        for(int i = 0; i < n; i++) x[i] = scan.nextInt();
        int out = Integer.MAX_VALUE;
        for(int i = 1; i <= 100; i++){
            int sum = 0;
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            if(out > sum) out = sum;
        }
        System.out.println(out);
        scan.close();
    }
} public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] x = new int[n];
        for(int i = 0; i < n; i++) x[i] = scan.nextInt();
        int out = Integer.MAX_VALUE;
        for(int i = 1; i <= 100; i++){
            int sum = 0;
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            if(out > sum) out = sum;
        }
        System.out.println(out);
        scan.close();
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] x = new int[n];
        for(int i = 0; i < n; i++) x[i] = scan.nextInt();
        int out = Integer.MAX_VALUE;
        for(int i = 1; i <= 100; i++){
            int sum = 0;
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            if(out > sum) out = sum;
        }
        System.out.println(out);
        scan.close();
    }
}
