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 min = Integer.MAX_VALUE;
        
        for(int i = 0; i <= 100; i++){
        	int sum = 0;
            for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            }
            min = Math.min(min, sum);
        }
        System.out.println(min);
    }
} 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 min = Integer.MAX_VALUE;
        
        for(int i = 0; i <= 100; i++){
        	int sum = 0;
            for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            }
            min = Math.min(min, sum);
        }
        System.out.println(min);
    }
} 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 min = Integer.MAX_VALUE;
        
        for(int i = 0; i <= 100; i++){
        	int sum = 0;
            for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            }
            min = Math.min(min, sum);
        }
        System.out.println(min);
    } 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 min = Integer.MAX_VALUE;
        
        for(int i = 0; i <= 100; i++){
        	int sum = 0;
            for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            }
            min = Math.min(min, sum);
        }
        System.out.println(min);
    } 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 min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 0; i <= 100; i++){
        	int sum = 0;
            for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            }
            min = Math.min(min, sum);
        } int i = 0; int i = 0; i 0 i <= 100 i 100 i++ i++ i {
        	int sum = 0;
            for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            }
            min = Math.min(min, sum);
        } {
        	int sum = 0;
            for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            }
            min = Math.min(min, sum);
        } int sum = 0; sum 0 for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            } int j = 0; int j = 0; j 0 j < N j N j++ j++ j {
            	sum += Math.pow((i - X[j]), 2);
            } {
            	sum += Math.pow((i - X[j]), 2);
            } sum += Math.pow((i - X[j]), 2) sum Math.pow((i - X[j]), 2) Math.pow Math (i - X[j]) i X[j] X j 2 min = Math.min(min, sum) min Math.min(min, sum) Math.min Math min sum System.out.println(min) System.out.println System.out System System.out min 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 min = Integer.MAX_VALUE;
        
        for(int i = 0; i <= 100; i++){
        	int sum = 0;
            for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            }
            min = Math.min(min, sum);
        }
        System.out.println(min);
    }
} 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 min = Integer.MAX_VALUE;
        
        for(int i = 0; i <= 100; i++){
        	int sum = 0;
            for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            }
            min = Math.min(min, sum);
        }
        System.out.println(min);
    }
} 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 min = Integer.MAX_VALUE;
        
        for(int i = 0; i <= 100; i++){
        	int sum = 0;
            for(int j = 0; j < N; j++){
            	sum += Math.pow((i - X[j]), 2);
            }
            min = Math.min(min, sum);
        }
        System.out.println(min);
    }
}