import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.CookieHandler;
import java.util.*;

public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException {
        int n = sc.nextInt();
        int[] x = new int[n];
        for(int i=0;i<n;i++) x[i] = sc.nextInt();
        long mini = Long.MAX_VALUE/2;
        for(int i=0;i<=100;i++){
            long cur = helper(x,i);
            mini = Math.min(mini,cur);
        }
        System.out.println(mini);
    }
    long helper(int[] x, int guess){
        long ans = 0;
        for(int s:x){
            long diff = s-guess;
            ans += diff*diff;
        }
        return ans;
    }
}
 import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io import java.net.CookieHandler; CookieHandler java.net import java.util.*; util.* java public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException {
        int n = sc.nextInt();
        int[] x = new int[n];
        for(int i=0;i<n;i++) x[i] = sc.nextInt();
        long mini = Long.MAX_VALUE/2;
        for(int i=0;i<=100;i++){
            long cur = helper(x,i);
            mini = Math.min(mini,cur);
        }
        System.out.println(mini);
    }
    long helper(int[] x, int guess){
        long ans = 0;
        for(int s:x){
            long diff = s-guess;
            ans += diff*diff;
        }
        return ans;
    }
} Main static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    } main {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args void solve() throws IOException {
        int n = sc.nextInt();
        int[] x = new int[n];
        for(int i=0;i<n;i++) x[i] = sc.nextInt();
        long mini = Long.MAX_VALUE/2;
        for(int i=0;i<=100;i++){
            long cur = helper(x,i);
            mini = Math.min(mini,cur);
        }
        System.out.println(mini);
    } solve {
        int n = sc.nextInt();
        int[] x = new int[n];
        for(int i=0;i<n;i++) x[i] = sc.nextInt();
        long mini = Long.MAX_VALUE/2;
        for(int i=0;i<=100;i++){
            long cur = helper(x,i);
            mini = Math.min(mini,cur);
        }
        System.out.println(mini);
    } 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] x i sc.nextInt() sc.nextInt sc long mini = Long.MAX_VALUE/2; mini Long.MAX_VALUE/2 Long.MAX_VALUE Long Long.MAX_VALUE 2 for(int i=0;i<=100;i++){
            long cur = helper(x,i);
            mini = Math.min(mini,cur);
        } int i=0; int i=0; i 0 i<=100 i 100 i++ i++ i {
            long cur = helper(x,i);
            mini = Math.min(mini,cur);
        } {
            long cur = helper(x,i);
            mini = Math.min(mini,cur);
        } long cur = helper(x,i); cur helper(x,i) helper x i mini = Math.min(mini,cur) mini Math.min(mini,cur) Math.min Math mini cur System.out.println(mini) System.out.println System.out System System.out mini long helper(int[] x, int guess){
        long ans = 0;
        for(int s:x){
            long diff = s-guess;
            ans += diff*diff;
        }
        return ans;
    } helper {
        long ans = 0;
        for(int s:x){
            long diff = s-guess;
            ans += diff*diff;
        }
        return ans;
    } long ans = 0; ans 0 for(int s:x){
            long diff = s-guess;
            ans += diff*diff;
        } int s x {
            long diff = s-guess;
            ans += diff*diff;
        } {
            long diff = s-guess;
            ans += diff*diff;
        } long diff = s-guess; diff s-guess s guess ans += diff*diff ans diff*diff diff diff return ans; ans int[] x x int guess guess public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException {
        int n = sc.nextInt();
        int[] x = new int[n];
        for(int i=0;i<n;i++) x[i] = sc.nextInt();
        long mini = Long.MAX_VALUE/2;
        for(int i=0;i<=100;i++){
            long cur = helper(x,i);
            mini = Math.min(mini,cur);
        }
        System.out.println(mini);
    }
    long helper(int[] x, int guess){
        long ans = 0;
        for(int s:x){
            long diff = s-guess;
            ans += diff*diff;
        }
        return ans;
    }
} public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException {
        int n = sc.nextInt();
        int[] x = new int[n];
        for(int i=0;i<n;i++) x[i] = sc.nextInt();
        long mini = Long.MAX_VALUE/2;
        for(int i=0;i<=100;i++){
            long cur = helper(x,i);
            mini = Math.min(mini,cur);
        }
        System.out.println(mini);
    }
    long helper(int[] x, int guess){
        long ans = 0;
        for(int s:x){
            long diff = s-guess;
            ans += diff*diff;
        }
        return ans;
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.CookieHandler;
import java.util.*;

public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException {
        int n = sc.nextInt();
        int[] x = new int[n];
        for(int i=0;i<n;i++) x[i] = sc.nextInt();
        long mini = Long.MAX_VALUE/2;
        for(int i=0;i<=100;i++){
            long cur = helper(x,i);
            mini = Math.min(mini,cur);
        }
        System.out.println(mini);
    }
    long helper(int[] x, int guess){
        long ans = 0;
        for(int s:x){
            long diff = s-guess;
            ans += diff*diff;
        }
        return ans;
    }
}

