n = int(input())
d = list(map(int, input().split()))

cnt, sumd =0, sum(d)
for i in d:
    cnt += i * (sumd - i)
print(cnt // 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 cnt, sumd =0, sum(d) cnt 0 sumd sum(d) sum d for i in d:
    cnt += i * (sumd - i) i d cnt += i * (sumd - i) cnt i * (sumd - i) i sumd - i sumd i print(cnt // 2) print cnt // 2 cnt 2 cnt += i * (sumd - i) i * (sumd - i) cnt sumd =0, sum(d) sum(d) sumd n = int(input()) int(input()) n d = list(map(int, input().split())) list(map(int, input().split())) d cnt, sumd =0, sum(d) 0 cnt
n = int(input())
d = list(map(int, input().split()))

cnt, sumd =0, sum(d)
for i in d:
    cnt += i * (sumd - i)
print(cnt // 2)
