N = int(input())
d = list(map(int, input().split()))
# l = []
total = 0
for i,iv in enumerate(d):
    for j,jv in enumerate(d):
        if i < j:
            # l.append([iv,jv])
            total += iv * jv
# print(l)
print(total) 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 total = 0 total 0 for i,iv in enumerate(d):
    for j,jv in enumerate(d):
        if i < j:
            # l.append([iv,jv])
            total += iv * jv
# print(l) i iv enumerate(d) enumerate d for j,jv in enumerate(d):
        if i < j:
            # l.append([iv,jv])
            total += iv * jv
# print(l) j jv enumerate(d) enumerate d if i < j:
            # l.append([iv,jv])
            total += iv * jv
# print(l) i < j i j total += iv * jv total iv * jv iv jv print(total) print total d = list(map(int, input().split())) list(map(int, input().split())) d N = int(input()) int(input()) N total = 0 0 total total += iv * jv iv * jv total
N = int(input())
d = list(map(int, input().split()))
# l = []
total = 0
for i,iv in enumerate(d):
    for j,jv in enumerate(d):
        if i < j:
            # l.append([iv,jv])
            total += iv * jv
# print(l)
print(total)