import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int N = Integer.parseInt(br.readLine());
		int[] X = new int[N];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<N; i++)
			X[i] = Integer.parseInt(st.nextToken());
		
		int min = Integer.MAX_VALUE;
		
		for(int p=1; p<100; p++) {
			int ans = 0;
			for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2);
			min = Math.min(ans, min);
		}
		
		System.out.println(min);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int N = Integer.parseInt(br.readLine());
		int[] X = new int[N];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<N; i++)
			X[i] = Integer.parseInt(st.nextToken());
		
		int min = Integer.MAX_VALUE;
		
		for(int p=1; p<100; p++) {
			int ans = 0;
			for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2);
			min = Math.min(ans, min);
		}
		
		System.out.println(min);
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int N = Integer.parseInt(br.readLine());
		int[] X = new int[N];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<N; i++)
			X[i] = Integer.parseInt(st.nextToken());
		
		int min = Integer.MAX_VALUE;
		
		for(int p=1; p<100; p++) {
			int ans = 0;
			for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2);
			min = Math.min(ans, min);
		}
		
		System.out.println(min);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int N = Integer.parseInt(br.readLine());
		int[] X = new int[N];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<N; i++)
			X[i] = Integer.parseInt(st.nextToken());
		
		int min = Integer.MAX_VALUE;
		
		for(int p=1; p<100; p++) {
			int ans = 0;
			for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2);
			min = Math.min(ans, min);
		}
		
		System.out.println(min);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] X = new int[N]; X new int[N] N StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) for(int i=0; i<N; i++)
			X[i] = Integer.parseInt(st.nextToken()); int i=0; int i=0; i 0 i<N i N i++ i++ i X[i] = Integer.parseInt(st.nextToken()); X[i] = Integer.parseInt(st.nextToken()) X[i] X i Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int p=1; p<100; p++) {
			int ans = 0;
			for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2);
			min = Math.min(ans, min);
		} int p=1; int p=1; p 1 p<100 p 100 p++ p++ p {
			int ans = 0;
			for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2);
			min = Math.min(ans, min);
		} {
			int ans = 0;
			for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2);
			min = Math.min(ans, min);
		} int ans = 0; ans 0 for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2); int i=0; int i=0; i 0 i<N i N i++ i++ i ans += (int)Math.pow(X[i] - p, 2); ans += (int)Math.pow(X[i] - p, 2) ans (int)Math.pow(X[i] - p, 2) Math.pow Math X[i] - p X[i] X i p 2 min = Math.min(ans, min) min Math.min(ans, min) Math.min Math ans min 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) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int N = Integer.parseInt(br.readLine());
		int[] X = new int[N];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<N; i++)
			X[i] = Integer.parseInt(st.nextToken());
		
		int min = Integer.MAX_VALUE;
		
		for(int p=1; p<100; p++) {
			int ans = 0;
			for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2);
			min = Math.min(ans, min);
		}
		
		System.out.println(min);
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int N = Integer.parseInt(br.readLine());
		int[] X = new int[N];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<N; i++)
			X[i] = Integer.parseInt(st.nextToken());
		
		int min = Integer.MAX_VALUE;
		
		for(int p=1; p<100; p++) {
			int ans = 0;
			for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2);
			min = Math.min(ans, min);
		}
		
		System.out.println(min);
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int N = Integer.parseInt(br.readLine());
		int[] X = new int[N];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<N; i++)
			X[i] = Integer.parseInt(st.nextToken());
		
		int min = Integer.MAX_VALUE;
		
		for(int p=1; p<100; p++) {
			int ans = 0;
			for(int i=0; i<N; i++)
				ans += (int)Math.pow(X[i] - p, 2);
			min = Math.min(ans, min);
		}
		
		System.out.println(min);
	}

}