import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
        }
        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= 100; i++) {
            int t = 0;
            for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            }
            if(t < ans) ans = t;
        }
        System.out.println(ans);
        sc.close();

    }

} 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[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
        }
        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= 100; i++) {
            int t = 0;
            for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            }
            if(t < ans) ans = t;
        }
        System.out.println(ans);
        sc.close();

    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
        }
        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= 100; i++) {
            int t = 0;
            for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            }
            if(t < ans) ans = t;
        }
        System.out.println(ans);
        sc.close();

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
        }
        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= 100; i++) {
            int t = 0;
            for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            }
            if(t < ans) ans = t;
        }
        System.out.println(ans);
        sc.close();

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] x = new int[n]; x new int[n] n for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            x[i] = sc.nextInt();
        } {
            x[i] = sc.nextInt();
        } x[i] = sc.nextInt() x[i] x i sc.nextInt() sc.nextInt sc int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 1; i <= 100; i++) {
            int t = 0;
            for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            }
            if(t < ans) ans = t;
        } int i = 1; int i = 1; i 1 i <= 100 i 100 i++ i++ i {
            int t = 0;
            for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            }
            if(t < ans) ans = t;
        } {
            int t = 0;
            for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            }
            if(t < ans) ans = t;
        } int t = 0; t 0 for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                t += (x[j] - i)*(x[j] - i);
            } {
                t += (x[j] - i)*(x[j] - i);
            } t += (x[j] - i)*(x[j] - i) t (x[j] - i)*(x[j] - i) (x[j] - i) x[j] x j i (x[j] - i) x[j] x j i if(t < ans) ans = t; t < ans t ans ans = t ans t System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
        }
        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= 100; i++) {
            int t = 0;
            for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            }
            if(t < ans) ans = t;
        }
        System.out.println(ans);
        sc.close();

    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
        }
        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= 100; i++) {
            int t = 0;
            for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            }
            if(t < ans) ans = t;
        }
        System.out.println(ans);
        sc.close();

    }

} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
        }
        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= 100; i++) {
            int t = 0;
            for (int j = 0; j < n; j++) {
                t += (x[j] - i)*(x[j] - i);
            }
            if(t < ans) ans = t;
        }
        System.out.println(ans);
        sc.close();

    }

}
