N=int(input())
D=list(map(int,input().split()))
print((sum(D)**2-sum(d*d for d in D))//2) N=int(input()) N int(input()) int input() input D=list(map(int,input().split())) D list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split print((sum(D)**2-sum(d*d for d in D))//2) print (sum(D)**2-sum(d*d for d in D))//2 sum(D)**2-sum(d*d for d in D) sum(D)**2 sum(D) sum D 2 sum(d*d for d in D) sum d*d d d 2 N=int(input()) int(input()) N D=list(map(int,input().split())) list(map(int,input().split())) D
N=int(input())
D=list(map(int,input().split()))
print((sum(D)**2-sum(d*d for d in D))//2)