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
 */
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);
        abc156_c solver = new abc156_c();
        solver.solve(1, in, out);
        out.close();
    }

    static class abc156_c {
        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 min = Integer.MAX_VALUE;
            for (int i = 1; i <= 100; i++) {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            }
            out.println(min);
        }

    }
}
 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);
        abc156_c solver = new abc156_c();
        solver.solve(1, in, out);
        out.close();
    }

    static class abc156_c {
        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 min = Integer.MAX_VALUE;
            for (int i = 1; i <= 100; i++) {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            }
            out.println(min);
        }

    }
} 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);
        abc156_c solver = new abc156_c();
        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);
        abc156_c solver = new abc156_c();
        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) abc156_c solver = new abc156_c(); solver new abc156_c() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class abc156_c {
        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 min = Integer.MAX_VALUE;
            for (int i = 1; i <= 100; i++) {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            }
            out.println(min);
        }

    } abc156_c 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 min = Integer.MAX_VALUE;
            for (int i = 1; i <= 100; i++) {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            }
            out.println(min);
        } solve {
            int N = in.nextInt();
            int x[] = new int[N];
            for (int i = 0; i < N; i++) {
                x[i] = in.nextInt();
            }
            int min = Integer.MAX_VALUE;
            for (int i = 1; i <= 100; i++) {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            }
            out.println(min);
        } 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 min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 1; i <= 100; i++) {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            } int i = 1; int i = 1; i 1 i <= 100 i 100 i++ i++ i {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            } {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            } int val = 0; val 0 for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                } int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
                    val += (x[j] - i) * (x[j] - i);
                } {
                    val += (x[j] - i) * (x[j] - i);
                } val += (x[j] - i) * (x[j] - i) val (x[j] - i) * (x[j] - i) (x[j] - i) x[j] x j i (x[j] - i) x[j] x j i min = Math.min(min, val) min Math.min(min, val) Math.min Math min val out.println(min) out.println out min 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);
        abc156_c solver = new abc156_c();
        solver.solve(1, in, out);
        out.close();
    }

    static class abc156_c {
        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 min = Integer.MAX_VALUE;
            for (int i = 1; i <= 100; i++) {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            }
            out.println(min);
        }

    }
} 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);
        abc156_c solver = new abc156_c();
        solver.solve(1, in, out);
        out.close();
    }

    static class abc156_c {
        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 min = Integer.MAX_VALUE;
            for (int i = 1; i <= 100; i++) {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            }
            out.println(min);
        }

    }
} 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
 */
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);
        abc156_c solver = new abc156_c();
        solver.solve(1, in, out);
        out.close();
    }

    static class abc156_c {
        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 min = Integer.MAX_VALUE;
            for (int i = 1; i <= 100; i++) {
                int val = 0;
                for (int j = 0; j < N; j++) {
                    val += (x[j] - i) * (x[j] - i);
                }
                min = Math.min(min, val);
            }
            out.println(min);
        }

    }
}

