import java.io.*;
import java.util.*;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long[] X = new long[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                X[i] = sc.nextLong();
        }

        final Solver solver = new Solver();
        solver.solve(N, X);
    }
}

class Solver {
    public void solve(long N, long[] X) {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            long sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow(X[j] - i, 2);
            }

            min = Math.min(min, sum);
        }
        System.out.println(min);
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long[] X = new long[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                X[i] = sc.nextLong();
        }

        final Solver solver = new Solver();
        solver.solve(N, X);
    }
} Main public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long[] X = new long[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                X[i] = sc.nextLong();
        }

        final Solver solver = new Solver();
        solver.solve(N, X);
    } main {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long[] X = new long[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                X[i] = sc.nextLong();
        }

        final Solver solver = new Solver();
        solver.solve(N, X);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N; N N = sc.nextLong() N sc.nextLong() sc.nextLong sc long[] X = new long[(int)(N)]; X new long[(int)(N)] (int)(N) for(int i = 0 ; i < N ; i++){
                X[i] = sc.nextLong();
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
                X[i] = sc.nextLong();
        } {
                X[i] = sc.nextLong();
        } X[i] = sc.nextLong() X[i] X i sc.nextLong() sc.nextLong sc final Solver solver = new Solver(); solver new Solver() solver.solve(N, X) solver.solve solver N X final String[] args args class Solver {
    public void solve(long N, long[] X) {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            long sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow(X[j] - i, 2);
            }

            min = Math.min(min, sum);
        }
        System.out.println(min);
    }
} Solver public void solve(long N, long[] X) {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            long sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow(X[j] - i, 2);
            }

            min = Math.min(min, sum);
        }
        System.out.println(min);
    } solve {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            long sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow(X[j] - i, 2);
            }

            min = Math.min(min, sum);
        }
        System.out.println(min);
    } long min = Long.MAX_VALUE; min Long.MAX_VALUE Long Long.MAX_VALUE for (int i = 0; i < 100; i++) {
            long sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow(X[j] - i, 2);
            }

            min = Math.min(min, sum);
        } int i = 0; int i = 0; i 0 i < 100 i 100 i++ i++ i {
            long sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow(X[j] - i, 2);
            }

            min = Math.min(min, sum);
        } {
            long sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow(X[j] - i, 2);
            }

            min = Math.min(min, sum);
        } long 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 min = Math.min(min, sum) min Math.min(min, sum) Math.min Math min sum System.out.println(min) System.out.println System.out System System.out min long N N long[] X X public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long[] X = new long[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                X[i] = sc.nextLong();
        }

        final Solver solver = new Solver();
        solver.solve(N, X);
    }
} public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long[] X = new long[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                X[i] = sc.nextLong();
        }

        final Solver solver = new Solver();
        solver.solve(N, X);
    }
} Main
import java.io.*;
import java.util.*;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long[] X = new long[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                X[i] = sc.nextLong();
        }

        final Solver solver = new Solver();
        solver.solve(N, X);
    }
}

class Solver {
    public void solve(long N, long[] X) {
        long min = Long.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            long sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow(X[j] - i, 2);
            }

            min = Math.min(min, sum);
        }
        System.out.println(min);
    }
}
