import java.util.Scanner;
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 ; i++){
            x[i] = sc.nextInt();
        }
        long s = 1000000;
        for(int i = 1 ; i <= 100 ; i++){
            long k = 0;
            for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            }
            if(s > k){
                s = k;
            }
        }
        System.out.println(s);
        sc.close();
    }
} import java.util.Scanner; Scanner 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 ; i++){
            x[i] = sc.nextInt();
        }
        long s = 1000000;
        for(int i = 1 ; i <= 100 ; i++){
            long k = 0;
            for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            }
            if(s > k){
                s = k;
            }
        }
        System.out.println(s);
        sc.close();
    }
} 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 ; i++){
            x[i] = sc.nextInt();
        }
        long s = 1000000;
        for(int i = 1 ; i <= 100 ; i++){
            long k = 0;
            for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            }
            if(s > k){
                s = k;
            }
        }
        System.out.println(s);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] x = new int[n];
        for(int i = 0 ; i < n ; i++){
            x[i] = sc.nextInt();
        }
        long s = 1000000;
        for(int i = 1 ; i <= 100 ; i++){
            long k = 0;
            for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            }
            if(s > k){
                s = k;
            }
        }
        System.out.println(s);
        sc.close();
    } 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 ; 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 long s = 1000000; s 1000000 for(int i = 1 ; i <= 100 ; i++){
            long k = 0;
            for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            }
            if(s > k){
                s = k;
            }
        } int i = 1 ; int i = 1 ; i 1 i <= 100 i 100 i++ i++ i {
            long k = 0;
            for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            }
            if(s > k){
                s = k;
            }
        } {
            long k = 0;
            for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            }
            if(s > k){
                s = k;
            }
        } long k = 0; k 0 for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            } int g = 0 ; int g = 0 ; g 0 g < n g n g++ g++ g {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            } {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            } k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g] k k + (x[g]) * (x[g]) + i * i - 2 * i * x[g] k + (x[g]) * (x[g]) + i * i k + (x[g]) * (x[g]) + i * i k (x[g]) * (x[g]) (x[g]) x g (x[g]) x g i * i i i 2 * i * x[g] 2 * i * x[g] 2 i x[g] x g if(s > k){
                s = k;
            } s > k s k {
                s = k;
            } s = k s k System.out.println(s) System.out.println System.out System System.out s sc.close() sc.close sc 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 ; i++){
            x[i] = sc.nextInt();
        }
        long s = 1000000;
        for(int i = 1 ; i <= 100 ; i++){
            long k = 0;
            for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            }
            if(s > k){
                s = k;
            }
        }
        System.out.println(s);
        sc.close();
    }
} 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 ; i++){
            x[i] = sc.nextInt();
        }
        long s = 1000000;
        for(int i = 1 ; i <= 100 ; i++){
            long k = 0;
            for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            }
            if(s > k){
                s = k;
            }
        }
        System.out.println(s);
        sc.close();
    }
} Main
import java.util.Scanner;
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 ; i++){
            x[i] = sc.nextInt();
        }
        long s = 1000000;
        for(int i = 1 ; i <= 100 ; i++){
            long k = 0;
            for(int g = 0 ; g < n ; g++) {
                k = k + (x[g]) * (x[g]) + i * i - 2 * i * x[g];
            }
            if(s > k){
                s = k;
            }
        }
        System.out.println(s);
        sc.close();
    }
}