
import java.util.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());

        Integer[] X = new Integer[N];
        for(int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(scanner.next());
        }


        Integer all = Integer.MAX_VALUE;
        for (int i = 1; i < 100; i++) {
            Integer ans = 0;
            for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            }
            all = Math.min(all, ans);
        }
        System.out.println(all);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());

        Integer[] X = new Integer[N];
        for(int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(scanner.next());
        }


        Integer all = Integer.MAX_VALUE;
        for (int i = 1; i < 100; i++) {
            Integer ans = 0;
            for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            }
            all = Math.min(all, ans);
        }
        System.out.println(all);
    }
} Main public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());

        Integer[] X = new Integer[N];
        for(int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(scanner.next());
        }


        Integer all = Integer.MAX_VALUE;
        for (int i = 1; i < 100; i++) {
            Integer ans = 0;
            for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            }
            all = Math.min(all, ans);
        }
        System.out.println(all);
    } main {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());

        Integer[] X = new Integer[N];
        for(int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(scanner.next());
        }


        Integer all = Integer.MAX_VALUE;
        for (int i = 1; i < 100; i++) {
            Integer ans = 0;
            for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            }
            all = Math.min(all, ans);
        }
        System.out.println(all);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) Integer N = Integer.parseInt(scanner.next()); N Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Integer[] X = new Integer[N]; X new Integer[N] N for(int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(scanner.next());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            X[i] = Integer.parseInt(scanner.next());
        } {
            X[i] = Integer.parseInt(scanner.next());
        } X[i] = Integer.parseInt(scanner.next()) X[i] X i Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner Integer all = Integer.MAX_VALUE; all Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 1; i < 100; i++) {
            Integer ans = 0;
            for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            }
            all = Math.min(all, ans);
        } int i = 1; int i = 1; i 1 i < 100 i 100 i++ i++ i {
            Integer ans = 0;
            for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            }
            all = Math.min(all, ans);
        } {
            Integer ans = 0;
            for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            }
            all = Math.min(all, ans);
        } Integer ans = 0; ans 0 for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            } int j = 0; int j = 0; j 0 j < X.length j X.length X X.length j++ j++ j {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            } {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            } ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i)) ans Math.abs((X[j]  - i) )* Math.abs((X[j]  - i)) Math.abs((X[j]  - i) ) Math.abs Math (X[j]  - i) X[j] X j i Math.abs((X[j]  - i)) Math.abs Math (X[j]  - i) X[j] X j i all = Math.min(all, ans) all Math.min(all, ans) Math.min Math all ans System.out.println(all) System.out.println System.out System System.out all String[] args args public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());

        Integer[] X = new Integer[N];
        for(int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(scanner.next());
        }


        Integer all = Integer.MAX_VALUE;
        for (int i = 1; i < 100; i++) {
            Integer ans = 0;
            for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            }
            all = Math.min(all, ans);
        }
        System.out.println(all);
    }
} public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());

        Integer[] X = new Integer[N];
        for(int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(scanner.next());
        }


        Integer all = Integer.MAX_VALUE;
        for (int i = 1; i < 100; i++) {
            Integer ans = 0;
            for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            }
            all = Math.min(all, ans);
        }
        System.out.println(all);
    }
} Main

import java.util.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        Integer N = Integer.parseInt(scanner.next());

        Integer[] X = new Integer[N];
        for(int i = 0; i < N; i++) {
            X[i] = Integer.parseInt(scanner.next());
        }


        Integer all = Integer.MAX_VALUE;
        for (int i = 1; i < 100; i++) {
            Integer ans = 0;
            for (int j = 0; j < X.length; j++) {
                ans += Math.abs((X[j]  - i) )* Math.abs((X[j]  - i));
            }
            all = Math.min(all, ans);
        }
        System.out.println(all);
    }
}
