n,*d = map(int,open(0).read().split())
print(sum((sum(d)-i)*i for i in d)//2) n,*d = map(int,open(0).read().split()) n map(int,open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *d d print(sum((sum(d)-i)*i for i in d)//2) print sum((sum(d)-i)*i for i in d)//2 sum((sum(d)-i)*i for i in d) sum (sum(d)-i)*i sum(d)-i sum(d) sum d i i 2 n,*d = map(int,open(0).read().split()) map(int,open(0).read().split()) n
n,*d = map(int,open(0).read().split())
print(sum((sum(d)-i)*i for i in d)//2)
