import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();// 石头块数
long h[] = new long[(int) n + 1];// 每一块石头高度
long s = 0;// 体力值
int j = 1;// 小青蛙将要跳到的石头
int k = (int) n;// 小青蛙当前所在的石头
int count = 0;
for (int i = 1; i <= n; i++) {
h[i] = sc.nextLong();
}
Arrays.sort(h);
// for (int i = 1; i <= n; i++) {
// System.out.print(h[i]+" ");//3 5 6
// }
s = s + h[(int) n] * h[(int) n];/