import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num_of_list = sc.nextInt();
        int[] number_list = new int[num_of_list];
        for(int i = 0;i < num_of_list;i++){
            number_list[i] = sc.nextInt();
        }
        int smallest = Integer.MAX_VALUE;
        for(int i = 0;i < 100;i++){
            int total = 0;
            for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            }
            if(total<smallest){
                smallest = total;
            }
        }
        System.out.println(smallest);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num_of_list = sc.nextInt();
        int[] number_list = new int[num_of_list];
        for(int i = 0;i < num_of_list;i++){
            number_list[i] = sc.nextInt();
        }
        int smallest = Integer.MAX_VALUE;
        for(int i = 0;i < 100;i++){
            int total = 0;
            for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            }
            if(total<smallest){
                smallest = total;
            }
        }
        System.out.println(smallest);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num_of_list = sc.nextInt();
        int[] number_list = new int[num_of_list];
        for(int i = 0;i < num_of_list;i++){
            number_list[i] = sc.nextInt();
        }
        int smallest = Integer.MAX_VALUE;
        for(int i = 0;i < 100;i++){
            int total = 0;
            for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            }
            if(total<smallest){
                smallest = total;
            }
        }
        System.out.println(smallest);
    } main {
        Scanner sc = new Scanner(System.in);
        int num_of_list = sc.nextInt();
        int[] number_list = new int[num_of_list];
        for(int i = 0;i < num_of_list;i++){
            number_list[i] = sc.nextInt();
        }
        int smallest = Integer.MAX_VALUE;
        for(int i = 0;i < 100;i++){
            int total = 0;
            for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            }
            if(total<smallest){
                smallest = total;
            }
        }
        System.out.println(smallest);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num_of_list = sc.nextInt(); num_of_list sc.nextInt() sc.nextInt sc int[] number_list = new int[num_of_list]; number_list new int[num_of_list] num_of_list for(int i = 0;i < num_of_list;i++){
            number_list[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < num_of_list i num_of_list i++ i++ i {
            number_list[i] = sc.nextInt();
        } {
            number_list[i] = sc.nextInt();
        } number_list[i] = sc.nextInt() number_list[i] number_list i sc.nextInt() sc.nextInt sc int smallest = Integer.MAX_VALUE; smallest Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 0;i < 100;i++){
            int total = 0;
            for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            }
            if(total<smallest){
                smallest = total;
            }
        } int i = 0; int i = 0; i 0 i < 100 i 100 i++ i++ i {
            int total = 0;
            for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            }
            if(total<smallest){
                smallest = total;
            }
        } {
            int total = 0;
            for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            }
            if(total<smallest){
                smallest = total;
            }
        } int total = 0; total 0 for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            } int j = 0; int j = 0; j 0 j < num_of_list j num_of_list j++ j++ j {
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            } {
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            } total += (number_list[j]-(i+1))*(number_list[j]-(i+1)) total (number_list[j]-(i+1))*(number_list[j]-(i+1)) (number_list[j]-(i+1)) number_list[j] number_list j (i+1) i 1 (number_list[j]-(i+1)) number_list[j] number_list j (i+1) i 1 if(total<smallest){
                smallest = total;
            } total<smallest total smallest {
                smallest = total;
            } smallest = total smallest total System.out.println(smallest) System.out.println System.out System System.out smallest String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num_of_list = sc.nextInt();
        int[] number_list = new int[num_of_list];
        for(int i = 0;i < num_of_list;i++){
            number_list[i] = sc.nextInt();
        }
        int smallest = Integer.MAX_VALUE;
        for(int i = 0;i < 100;i++){
            int total = 0;
            for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            }
            if(total<smallest){
                smallest = total;
            }
        }
        System.out.println(smallest);
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num_of_list = sc.nextInt();
        int[] number_list = new int[num_of_list];
        for(int i = 0;i < num_of_list;i++){
            number_list[i] = sc.nextInt();
        }
        int smallest = Integer.MAX_VALUE;
        for(int i = 0;i < 100;i++){
            int total = 0;
            for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            }
            if(total<smallest){
                smallest = total;
            }
        }
        System.out.println(smallest);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num_of_list = sc.nextInt();
        int[] number_list = new int[num_of_list];
        for(int i = 0;i < num_of_list;i++){
            number_list[i] = sc.nextInt();
        }
        int smallest = Integer.MAX_VALUE;
        for(int i = 0;i < 100;i++){
            int total = 0;
            for(int j = 0;j < num_of_list;j++){
                total += (number_list[j]-(i+1))*(number_list[j]-(i+1));
            }
            if(total<smallest){
                smallest = total;
            }
        }
        System.out.println(smallest);
    }
}