import java.util.*;
import java.math.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int humans = sc.nextInt();
    
    int[] lives = new int[humans];
    
    for(int i=0;i<humans;i++){
      lives[i] = sc.nextInt();
    }
    
    int minPowerPoint = -1;
    int minPower = -1;
    
    for(int p = 1; p <= 100 ; p++){
      int power = 0;
      for(int live:lives){
        power += Math.pow(live-p,2);
      }
      
      if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      }
    }
    System.out.println(minPower);
    
    
  }
} import java.util.*; util.* java import java.math.*; math.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int humans = sc.nextInt();
    
    int[] lives = new int[humans];
    
    for(int i=0;i<humans;i++){
      lives[i] = sc.nextInt();
    }
    
    int minPowerPoint = -1;
    int minPower = -1;
    
    for(int p = 1; p <= 100 ; p++){
      int power = 0;
      for(int live:lives){
        power += Math.pow(live-p,2);
      }
      
      if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      }
    }
    System.out.println(minPower);
    
    
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int humans = sc.nextInt();
    
    int[] lives = new int[humans];
    
    for(int i=0;i<humans;i++){
      lives[i] = sc.nextInt();
    }
    
    int minPowerPoint = -1;
    int minPower = -1;
    
    for(int p = 1; p <= 100 ; p++){
      int power = 0;
      for(int live:lives){
        power += Math.pow(live-p,2);
      }
      
      if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      }
    }
    System.out.println(minPower);
    
    
  } main {
    Scanner sc = new Scanner(System.in);
    int humans = sc.nextInt();
    
    int[] lives = new int[humans];
    
    for(int i=0;i<humans;i++){
      lives[i] = sc.nextInt();
    }
    
    int minPowerPoint = -1;
    int minPower = -1;
    
    for(int p = 1; p <= 100 ; p++){
      int power = 0;
      for(int live:lives){
        power += Math.pow(live-p,2);
      }
      
      if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      }
    }
    System.out.println(minPower);
    
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int humans = sc.nextInt(); humans sc.nextInt() sc.nextInt sc int[] lives = new int[humans]; lives new int[humans] humans for(int i=0;i<humans;i++){
      lives[i] = sc.nextInt();
    } int i=0; int i=0; i 0 i<humans i humans i++ i++ i {
      lives[i] = sc.nextInt();
    } {
      lives[i] = sc.nextInt();
    } lives[i] = sc.nextInt() lives[i] lives i sc.nextInt() sc.nextInt sc int minPowerPoint = -1; minPowerPoint -1 1 int minPower = -1; minPower -1 1 for(int p = 1; p <= 100 ; p++){
      int power = 0;
      for(int live:lives){
        power += Math.pow(live-p,2);
      }
      
      if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      }
    } int p = 1; int p = 1; p 1 p <= 100 p 100 p++ p++ p {
      int power = 0;
      for(int live:lives){
        power += Math.pow(live-p,2);
      }
      
      if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      }
    } {
      int power = 0;
      for(int live:lives){
        power += Math.pow(live-p,2);
      }
      
      if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      }
    } int power = 0; power 0 for(int live:lives){
        power += Math.pow(live-p,2);
      } int live lives {
        power += Math.pow(live-p,2);
      } {
        power += Math.pow(live-p,2);
      } power += Math.pow(live-p,2) power Math.pow(live-p,2) Math.pow Math live-p live p 2 if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      } minPowerPoint == -1 || power < minPower minPowerPoint == -1 minPowerPoint -1 1 power < minPower power minPower {
        minPowerPoint = p;
        minPower = power;
      } minPowerPoint = p minPowerPoint p minPower = power minPower power System.out.println(minPower) System.out.println System.out System System.out minPower String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int humans = sc.nextInt();
    
    int[] lives = new int[humans];
    
    for(int i=0;i<humans;i++){
      lives[i] = sc.nextInt();
    }
    
    int minPowerPoint = -1;
    int minPower = -1;
    
    for(int p = 1; p <= 100 ; p++){
      int power = 0;
      for(int live:lives){
        power += Math.pow(live-p,2);
      }
      
      if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      }
    }
    System.out.println(minPower);
    
    
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int humans = sc.nextInt();
    
    int[] lives = new int[humans];
    
    for(int i=0;i<humans;i++){
      lives[i] = sc.nextInt();
    }
    
    int minPowerPoint = -1;
    int minPower = -1;
    
    for(int p = 1; p <= 100 ; p++){
      int power = 0;
      for(int live:lives){
        power += Math.pow(live-p,2);
      }
      
      if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      }
    }
    System.out.println(minPower);
    
    
  }
} Main
import java.util.*;
import java.math.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int humans = sc.nextInt();
    
    int[] lives = new int[humans];
    
    for(int i=0;i<humans;i++){
      lives[i] = sc.nextInt();
    }
    
    int minPowerPoint = -1;
    int minPower = -1;
    
    for(int p = 1; p <= 100 ; p++){
      int power = 0;
      for(int live:lives){
        power += Math.pow(live-p,2);
      }
      
      if(minPowerPoint == -1 || power < minPower){
        minPowerPoint = p;
        minPower = power;
      }
    }
    System.out.println(minPower);
    
    
  }
}