N = int(input())
D = [int(s) for s in input().split(' ')]
D_sum = sum(D)
ret = 0
for d in D:
    ret += d * (D_sum - d)

print(ret // 2)
 N = int(input()) N int(input()) int input() input int(s) for s in input().split(' ') for s in input().split(' ') s input().split(' ') ().split () input split ' ' for s in input().split(' ') int(s) int s D = [int(s) for s in input().split(' ')] D [int(s) for s in input().split(' ')] D_sum = sum(D) D_sum sum(D) sum D ret = 0 ret 0 for d in D:
    ret += d * (D_sum - d) d D ret += d * (D_sum - d) ret d * (D_sum - d) d D_sum - d D_sum d print(ret // 2) print ret // 2 ret 2 D_sum = sum(D) sum(D) D_sum ret = 0 0 ret D = [int(s) for s in input().split(' ')] [int(s) for s in input().split(' ')] D N = int(input()) int(input()) N ret += d * (D_sum - d) d * (D_sum - d) ret
N = int(input())
D = [int(s) for s in input().split(' ')]
D_sum = sum(D)
ret = 0
for d in D:
    ret += d * (D_sum - d)

print(ret // 2)

