import itertools


def actual(n, D):
    comb = itertools.combinations(D, 2)

    return sum([x * y for x, y in comb])

n = int(input())
D = map(int, input().split())

print(actual(n, D)) import itertools itertools def actual(n, D):
    comb = itertools.combinations(D, 2)

    return sum([x * y for x, y in comb]) actual comb = itertools.combinations(D, 2) comb itertools.combinations(D, 2) itertools.combinations itertools combinations D 2 x * y for x, y in comb for x, y in comb x y comb for x, y in comb x * y x y return sum([x * y for x, y in comb]) sum([x * y for x, y in comb]) sum [x * y for x, y in comb] n n D D n = int(input()) n int(input()) int input() input D = map(int, input().split()) D map(int, input().split()) map int input().split() ().split () input split print(actual(n, D)) print actual(n, D) actual n D def actual(n, D):
    comb = itertools.combinations(D, 2)

    return sum([x * y for x, y in comb]) def actual(n, D):
    comb = itertools.combinations(D, 2)

    return sum([x * y for x, y in comb]) actual n = int(input()) int(input()) n D = map(int, input().split()) map(int, input().split()) D
import itertools


def actual(n, D):
    comb = itertools.combinations(D, 2)

    return sum([x * y for x, y in comb])

n = int(input())
D = map(int, input().split())

print(actual(n, D))