import itertools

N = int(input())
D = tuple(map(int, input().split()))

ans = sum(x * y for x, y in itertools.combinations(D, 2))
print(ans) import itertools itertools N = int(input()) N int(input()) int input() input D = tuple(map(int, input().split())) D tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split ans = sum(x * y for x, y in itertools.combinations(D, 2)) ans sum(x * y for x, y in itertools.combinations(D, 2)) sum x * y x y print(ans) print ans N = int(input()) int(input()) N D = tuple(map(int, input().split())) tuple(map(int, input().split())) D ans = sum(x * y for x, y in itertools.combinations(D, 2)) sum(x * y for x, y in itertools.combinations(D, 2)) ans
import itertools

N = int(input())
D = tuple(map(int, input().split()))

ans = sum(x * y for x, y in itertools.combinations(D, 2))
print(ans)
