import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        final int[] X = new int[N];
        for (int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(sc.next());
        }

        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            double total = 0;
            for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            }
            ans = Math.min(ans, (int)total);
        }

        System.out.println(ans);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        final int[] X = new int[N];
        for (int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(sc.next());
        }

        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            double total = 0;
            for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            }
            ans = Math.min(ans, (int)total);
        }

        System.out.println(ans);
    }
} Main public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        final int[] X = new int[N];
        for (int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(sc.next());
        }

        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            double total = 0;
            for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            }
            ans = Math.min(ans, (int)total);
        }

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        final int[] X = new int[N];
        for (int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(sc.next());
        }

        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            double total = 0;
            for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            }
            ans = Math.min(ans, (int)total);
        }

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc final int[] X = new int[N]; X new int[N] N for (int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(sc.next());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            X[i] = Integer.parseInt(sc.next());
        } {
            X[i] = Integer.parseInt(sc.next());
        } X[i] = Integer.parseInt(sc.next()) X[i] X i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i < 100; i++) {
            double total = 0;
            for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            }
            ans = Math.min(ans, (int)total);
        } int i = 0; int i = 0; i 0 i < 100 i 100 i++ i++ i {
            double total = 0;
            for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            }
            ans = Math.min(ans, (int)total);
        } {
            double total = 0;
            for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            }
            ans = Math.min(ans, (int)total);
        } double total = 0; total 0 for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            } int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
                total += Math.pow(X[j] - (i+1), 2);
            } {
                total += Math.pow(X[j] - (i+1), 2);
            } total += Math.pow(X[j] - (i+1), 2) total Math.pow(X[j] - (i+1), 2) Math.pow Math X[j] - (i+1) X[j] X j (i+1) i 1 2 ans = Math.min(ans, (int)total) ans Math.min(ans, (int)total) Math.min Math ans (int)total System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        final int[] X = new int[N];
        for (int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(sc.next());
        }

        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            double total = 0;
            for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            }
            ans = Math.min(ans, (int)total);
        }

        System.out.println(ans);
    }
} public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        final int[] X = new int[N];
        for (int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(sc.next());
        }

        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            double total = 0;
            for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            }
            ans = Math.min(ans, (int)total);
        }

        System.out.println(ans);
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        final int[] X = new int[N];
        for (int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(sc.next());
        }

        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < 100; i++) {
            double total = 0;
            for (int j = 0; j < N; j++) {
                total += Math.pow(X[j] - (i+1), 2);
            }
            ans = Math.min(ans, (int)total);
        }

        System.out.println(ans);
    }
}
