import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] x = new int[n];
    long sum = Long.MAX_VALUE;
    for(int i = 0; i < n; i++){
      x[i] = sc.nextInt();
    }
    for(int i = 1; i <= 100; i++){
    	long temp = 0;
      for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      }
      if(sum > temp){
        sum = temp;
      }
    }
    System.out.println(sum);
  }
} import java.util.Scanner; Scanner 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];
    long sum = Long.MAX_VALUE;
    for(int i = 0; i < n; i++){
      x[i] = sc.nextInt();
    }
    for(int i = 1; i <= 100; i++){
    	long temp = 0;
      for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      }
      if(sum > temp){
        sum = temp;
      }
    }
    System.out.println(sum);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] x = new int[n];
    long sum = Long.MAX_VALUE;
    for(int i = 0; i < n; i++){
      x[i] = sc.nextInt();
    }
    for(int i = 1; i <= 100; i++){
    	long temp = 0;
      for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      }
      if(sum > temp){
        sum = temp;
      }
    }
    System.out.println(sum);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] x = new int[n];
    long sum = Long.MAX_VALUE;
    for(int i = 0; i < n; i++){
      x[i] = sc.nextInt();
    }
    for(int i = 1; i <= 100; i++){
    	long temp = 0;
      for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      }
      if(sum > temp){
        sum = temp;
      }
    }
    System.out.println(sum);
  } 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 long sum = Long.MAX_VALUE; sum Long.MAX_VALUE Long Long.MAX_VALUE 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 for(int i = 1; i <= 100; i++){
    	long temp = 0;
      for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      }
      if(sum > temp){
        sum = temp;
      }
    } int i = 1; int i = 1; i 1 i <= 100 i 100 i++ i++ i {
    	long temp = 0;
      for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      }
      if(sum > temp){
        sum = temp;
      }
    } {
    	long temp = 0;
      for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      }
      if(sum > temp){
        sum = temp;
      }
    } long temp = 0; temp 0 for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
        temp += Math.pow(x[j]-i,2);
      } {
        temp += Math.pow(x[j]-i,2);
      } temp += Math.pow(x[j]-i,2) temp Math.pow(x[j]-i,2) Math.pow Math x[j]-i x[j] x j i 2 if(sum > temp){
        sum = temp;
      } sum > temp sum temp {
        sum = temp;
      } sum = temp sum temp System.out.println(sum) System.out.println System.out System System.out sum 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];
    long sum = Long.MAX_VALUE;
    for(int i = 0; i < n; i++){
      x[i] = sc.nextInt();
    }
    for(int i = 1; i <= 100; i++){
    	long temp = 0;
      for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      }
      if(sum > temp){
        sum = temp;
      }
    }
    System.out.println(sum);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] x = new int[n];
    long sum = Long.MAX_VALUE;
    for(int i = 0; i < n; i++){
      x[i] = sc.nextInt();
    }
    for(int i = 1; i <= 100; i++){
    	long temp = 0;
      for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      }
      if(sum > temp){
        sum = temp;
      }
    }
    System.out.println(sum);
  }
} Main
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] x = new int[n];
    long sum = Long.MAX_VALUE;
    for(int i = 0; i < n; i++){
      x[i] = sc.nextInt();
    }
    for(int i = 1; i <= 100; i++){
    	long temp = 0;
      for(int j = 0; j < n; j++){
        temp += Math.pow(x[j]-i,2);
      }
      if(sum > temp){
        sum = temp;
      }
    }
    System.out.println(sum);
  }
}