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 varunvats32
 */
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[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int stamina = Integer.MAX_VALUE;

            for (int i = 1; i <= 100; i++) {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            }

            out.println(stamina);
        }

    }
}
 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[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int stamina = Integer.MAX_VALUE;

            for (int i = 1; i <= 100; i++) {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            }

            out.println(stamina);
        }

    }
} 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[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int stamina = Integer.MAX_VALUE;

            for (int i = 1; i <= 100; i++) {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            }

            out.println(stamina);
        }

    } CRally public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int stamina = Integer.MAX_VALUE;

            for (int i = 1; i <= 100; i++) {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            }

            out.println(stamina);
        } solve {
            int n = in.nextInt();
            int[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int stamina = Integer.MAX_VALUE;

            for (int i = 1; i <= 100; i++) {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            }

            out.println(stamina);
        } int n = in.nextInt(); n in.nextInt() in.nextInt in int[] arr = new int[n]; arr new int[n] n for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                arr[i] = in.nextInt();
            } {
                arr[i] = in.nextInt();
            } arr[i] = in.nextInt() arr[i] arr i in.nextInt() in.nextInt in int stamina = Integer.MAX_VALUE; stamina Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 1; i <= 100; i++) {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            } int i = 1; int i = 1; i 1 i <= 100 i 100 i++ i++ i {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            } {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            } int st = 0; st 0 for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                    st += Math.pow(i - arr[j], 2);
                } {
                    st += Math.pow(i - arr[j], 2);
                } st += Math.pow(i - arr[j], 2) st Math.pow(i - arr[j], 2) Math.pow Math i - arr[j] i arr[j] arr j 2 stamina = Math.min(st, stamina) stamina Math.min(st, stamina) Math.min Math st stamina out.println(stamina) out.println out stamina 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[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int stamina = Integer.MAX_VALUE;

            for (int i = 1; i <= 100; i++) {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            }

            out.println(stamina);
        }

    }
} 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[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int stamina = Integer.MAX_VALUE;

            for (int i = 1; i <= 100; i++) {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            }

            out.println(stamina);
        }

    }
} 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 varunvats32
 */
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[] arr = new int[n];

            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }

            int stamina = Integer.MAX_VALUE;

            for (int i = 1; i <= 100; i++) {
                int st = 0;
                for (int j = 0; j < n; j++) {
                    st += Math.pow(i - arr[j], 2);
                }
                stamina = Math.min(st, stamina);
            }

            out.println(stamina);
        }

    }
}

