import java.util.*;

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

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