import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num1 = scanner.nextInt();
//        int num2 = scanner.nextInt();
        int[] a = new int[num1];
        int count1 = 0,count2 = 0, count3 = 0;
        int s = 0;
        for (int i = 0; i < num1; i++) {
            a[i] = scanner.nextInt();
        }
        for (int i = 0 ; i < num1; i++) {
            s = s + a[i] * a[i];
        }
        System.out.println(s);

    }

    public static boolean judge(int i,int j){
        int a,s = 0;
        while(i != 0){
            a = i % 10;
            s = s + a;
            i /= 10;
        }
        if(s == j)return true;
        else return false;
    }

    public static void paiXu(int[] a){
        int temp;
        for(int i = 0;i < a.length - 1;i++){
            for(int k = 0;k < a.length - i - 1;k++){
                if(a[k] > a[k + 1]){
                    temp = a[k];
                    a[k] = a[k + 1];
                    a[k + 1] = temp;
                }
            }
        }
    }
}

/**************************************************************
	Problem: 1830
	User: admin
	Language: Java
	Result: Accepted
	Time:1056 ms
	Memory:39856 kb
****************************************************************/