import java.util.ArrayList;
import java.util.Scanner;

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

        int n;
        n = cin.nextInt();

        ArrayList<Integer> x  = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            x.add(cin.nextInt());
        }

        int xSquareMin = 1000000000;

        for (int i = 0; i < 101; i ++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            }
            if (sum < xSquareMin) {
                xSquareMin = sum;
            }
        }
        System.out.println(xSquareMin);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);

        int n;
        n = cin.nextInt();

        ArrayList<Integer> x  = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            x.add(cin.nextInt());
        }

        int xSquareMin = 1000000000;

        for (int i = 0; i < 101; i ++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            }
            if (sum < xSquareMin) {
                xSquareMin = sum;
            }
        }
        System.out.println(xSquareMin);
    }
} Main public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);

        int n;
        n = cin.nextInt();

        ArrayList<Integer> x  = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            x.add(cin.nextInt());
        }

        int xSquareMin = 1000000000;

        for (int i = 0; i < 101; i ++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            }
            if (sum < xSquareMin) {
                xSquareMin = sum;
            }
        }
        System.out.println(xSquareMin);
    } main {
        Scanner cin = new Scanner(System.in);

        int n;
        n = cin.nextInt();

        ArrayList<Integer> x  = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            x.add(cin.nextInt());
        }

        int xSquareMin = 1000000000;

        for (int i = 0; i < 101; i ++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            }
            if (sum < xSquareMin) {
                xSquareMin = sum;
            }
        }
        System.out.println(xSquareMin);
    } Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int n; n n = cin.nextInt() n cin.nextInt() cin.nextInt cin ArrayList<Integer> x  = new ArrayList<>(); x new ArrayList<>() for (int i = 0; i < n; i++) {
            x.add(cin.nextInt());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            x.add(cin.nextInt());
        } {
            x.add(cin.nextInt());
        } x.add(cin.nextInt()) x.add x cin.nextInt() cin.nextInt cin int xSquareMin = 1000000000; xSquareMin 1000000000 for (int i = 0; i < 101; i ++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            }
            if (sum < xSquareMin) {
                xSquareMin = sum;
            }
        } int i = 0; int i = 0; i 0 i < 101 i 101 i ++ i ++ i {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            }
            if (sum < xSquareMin) {
                xSquareMin = sum;
            }
        } {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            }
            if (sum < xSquareMin) {
                xSquareMin = sum;
            }
        } int sum = 0; sum 0 for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                sum += (x.get(j) - i) * (x.get(j) - i);
            } {
                sum += (x.get(j) - i) * (x.get(j) - i);
            } sum += (x.get(j) - i) * (x.get(j) - i) sum (x.get(j) - i) * (x.get(j) - i) (x.get(j) - i) x.get(j) x.get x j i (x.get(j) - i) x.get(j) x.get x j i if (sum < xSquareMin) {
                xSquareMin = sum;
            } sum < xSquareMin sum xSquareMin {
                xSquareMin = sum;
            } xSquareMin = sum xSquareMin sum System.out.println(xSquareMin) System.out.println System.out System System.out xSquareMin String[] args args public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);

        int n;
        n = cin.nextInt();

        ArrayList<Integer> x  = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            x.add(cin.nextInt());
        }

        int xSquareMin = 1000000000;

        for (int i = 0; i < 101; i ++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            }
            if (sum < xSquareMin) {
                xSquareMin = sum;
            }
        }
        System.out.println(xSquareMin);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);

        int n;
        n = cin.nextInt();

        ArrayList<Integer> x  = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            x.add(cin.nextInt());
        }

        int xSquareMin = 1000000000;

        for (int i = 0; i < 101; i ++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            }
            if (sum < xSquareMin) {
                xSquareMin = sum;
            }
        }
        System.out.println(xSquareMin);
    }
} Main
import java.util.ArrayList;
import java.util.Scanner;

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

        int n;
        n = cin.nextInt();

        ArrayList<Integer> x  = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            x.add(cin.nextInt());
        }

        int xSquareMin = 1000000000;

        for (int i = 0; i < 101; i ++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += (x.get(j) - i) * (x.get(j) - i);
            }
            if (sum < xSquareMin) {
                xSquareMin = sum;
            }
        }
        System.out.println(xSquareMin);
    }
}
