import java.util.*;

public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] Xz = new int[N];
        for (int i = 0; i < N; i++) {
            Xz[i] = sc.nextInt();
        }
        int sum = 0;
        int minSum = 1000000000;
        for (int i = 1; i < 100; i++) {
            sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            }
            if (sum < minSum) {
                minSum = sum;
            }
        }
        System.out.println(minSum);
    }
}
 import java.util.*; util.* java public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] Xz = new int[N];
        for (int i = 0; i < N; i++) {
            Xz[i] = sc.nextInt();
        }
        int sum = 0;
        int minSum = 1000000000;
        for (int i = 1; i < 100; i++) {
            sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            }
            if (sum < minSum) {
                minSum = sum;
            }
        }
        System.out.println(minSum);
    }
} Main public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] Xz = new int[N];
        for (int i = 0; i < N; i++) {
            Xz[i] = sc.nextInt();
        }
        int sum = 0;
        int minSum = 1000000000;
        for (int i = 1; i < 100; i++) {
            sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            }
            if (sum < minSum) {
                minSum = sum;
            }
        }
        System.out.println(minSum);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] Xz = new int[N];
        for (int i = 0; i < N; i++) {
            Xz[i] = sc.nextInt();
        }
        int sum = 0;
        int minSum = 1000000000;
        for (int i = 1; i < 100; i++) {
            sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            }
            if (sum < minSum) {
                minSum = sum;
            }
        }
        System.out.println(minSum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] Xz = new int[N]; Xz new int[N] N for (int i = 0; i < N; i++) {
            Xz[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            Xz[i] = sc.nextInt();
        } {
            Xz[i] = sc.nextInt();
        } Xz[i] = sc.nextInt() Xz[i] Xz i sc.nextInt() sc.nextInt sc int sum = 0; sum 0 int minSum = 1000000000; minSum 1000000000 for (int i = 1; i < 100; i++) {
            sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            }
            if (sum < minSum) {
                minSum = sum;
            }
        } int i = 1; int i = 1; i 1 i < 100 i 100 i++ i++ i {
            sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            }
            if (sum < minSum) {
                minSum = sum;
            }
        } {
            sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            }
            if (sum < minSum) {
                minSum = sum;
            }
        } sum = 0 sum 0 for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            } int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
                sum += Math.pow((Xz[j] - i), 2);
            } {
                sum += Math.pow((Xz[j] - i), 2);
            } sum += Math.pow((Xz[j] - i), 2) sum Math.pow((Xz[j] - i), 2) Math.pow Math (Xz[j] - i) Xz[j] Xz j i 2 if (sum < minSum) {
                minSum = sum;
            } sum < minSum sum minSum {
                minSum = sum;
            } minSum = sum minSum sum System.out.println(minSum) System.out.println System.out System System.out minSum String[] args args public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] Xz = new int[N];
        for (int i = 0; i < N; i++) {
            Xz[i] = sc.nextInt();
        }
        int sum = 0;
        int minSum = 1000000000;
        for (int i = 1; i < 100; i++) {
            sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            }
            if (sum < minSum) {
                minSum = sum;
            }
        }
        System.out.println(minSum);
    }
} public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] Xz = new int[N];
        for (int i = 0; i < N; i++) {
            Xz[i] = sc.nextInt();
        }
        int sum = 0;
        int minSum = 1000000000;
        for (int i = 1; i < 100; i++) {
            sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            }
            if (sum < minSum) {
                minSum = sum;
            }
        }
        System.out.println(minSum);
    }
} Main
import java.util.*;

public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] Xz = new int[N];
        for (int i = 0; i < N; i++) {
            Xz[i] = sc.nextInt();
        }
        int sum = 0;
        int minSum = 1000000000;
        for (int i = 1; i < 100; i++) {
            sum = 0;
            for (int j = 0; j < N; j++) {
                sum += Math.pow((Xz[j] - i), 2);
            }
            if (sum < minSum) {
                minSum = sum;
            }
        }
        System.out.println(minSum);
    }
}

