import java.util.*;

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

class Main{
    void solve(){
        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 sum = 0;
        int out = Integer.MAX_VALUE;
        for(int i = 1; i <= 100; i++){
            for(int j = 0; j < n; j++){
                sum += Math.pow(x[j] - i, 2);
            }
            out = Math.min(sum, out);
            sum = 0;
        }
        System.out.println(out);
        scan.close();
    }
    public static void main(String[] args){
        new Main().solve();
    }
}
