import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CRally solver = new CRally();
        solver.solve(1, in, out);
        out.close();
    }

    static class CRally {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] x = new int[n];
            // 気合で
            for (int i = 0; i < n; i++) {
                x[i] = in.nextInt();
            }
            int sum = 100000000;
            for (int i = 1; i <= 100; i++) {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            }
            out.println(sum);
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CRally solver = new CRally();
        solver.solve(1, in, out);
        out.close();
    }

    static class CRally {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] x = new int[n];
            // 気合で
            for (int i = 0; i < n; i++) {
                x[i] = in.nextInt();
            }
            int sum = 100000000;
            for (int i = 1; i <= 100; i++) {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            }
            out.println(sum);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CRally solver = new CRally();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CRally solver = new CRally();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) CRally solver = new CRally(); solver new CRally() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class CRally {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] x = new int[n];
            // 気合で
            for (int i = 0; i < n; i++) {
                x[i] = in.nextInt();
            }
            int sum = 100000000;
            for (int i = 1; i <= 100; i++) {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            }
            out.println(sum);
        }

    } CRally public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] x = new int[n];
            // 気合で
            for (int i = 0; i < n; i++) {
                x[i] = in.nextInt();
            }
            int sum = 100000000;
            for (int i = 1; i <= 100; i++) {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            }
            out.println(sum);
        } solve {
            int n = in.nextInt();
            int[] x = new int[n];
            // 気合で
            for (int i = 0; i < n; i++) {
                x[i] = in.nextInt();
            }
            int sum = 100000000;
            for (int i = 1; i <= 100; i++) {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            }
            out.println(sum);
        } int n = in.nextInt(); n in.nextInt() in.nextInt in int[] x = new int[n]; x new int[n] n for (int i = 0; i < n; i++) {
                x[i] = in.nextInt();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                x[i] = in.nextInt();
            } {
                x[i] = in.nextInt();
            } x[i] = in.nextInt() x[i] x i in.nextInt() in.nextInt in int sum = 100000000; sum 100000000 for (int i = 1; i <= 100; i++) {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            } int i = 1; int i = 1; i 1 i <= 100 i 100 i++ i++ i {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            } {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            } int tmp = 0; tmp 0 for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                    tmp += (i - x[j]) * (i - x[j]);
                } {
                    tmp += (i - x[j]) * (i - x[j]);
                } tmp += (i - x[j]) * (i - x[j]) tmp (i - x[j]) * (i - x[j]) (i - x[j]) i x[j] x j (i - x[j]) i x[j] x j sum = Math.min(sum, tmp) sum Math.min(sum, tmp) Math.min Math sum tmp out.println(sum) out.println out sum int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CRally solver = new CRally();
        solver.solve(1, in, out);
        out.close();
    }

    static class CRally {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] x = new int[n];
            // 気合で
            for (int i = 0; i < n; i++) {
                x[i] = in.nextInt();
            }
            int sum = 100000000;
            for (int i = 1; i <= 100; i++) {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            }
            out.println(sum);
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CRally solver = new CRally();
        solver.solve(1, in, out);
        out.close();
    }

    static class CRally {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] x = new int[n];
            // 気合で
            for (int i = 0; i < n; i++) {
                x[i] = in.nextInt();
            }
            int sum = 100000000;
            for (int i = 1; i <= 100; i++) {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            }
            out.println(sum);
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CRally solver = new CRally();
        solver.solve(1, in, out);
        out.close();
    }

    static class CRally {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] x = new int[n];
            // 気合で
            for (int i = 0; i < n; i++) {
                x[i] = in.nextInt();
            }
            int sum = 100000000;
            for (int i = 1; i <= 100; i++) {
                // 中心はi
                int tmp = 0;
                for (int j = 0; j < n; j++) {
                    tmp += (i - x[j]) * (i - x[j]);
                }
                sum = Math.min(sum, tmp);
            }
            out.println(sum);
        }

    }
}

