def resolve():
    N = int(input())
    D = list(map(int, input().split()))
    ans = 0
    import itertools
    for x, y in itertools.combinations(D, 2):
        ans += x*y
    print(ans)

if '__main__' == __name__:
    resolve() def resolve():
    N = int(input())
    D = list(map(int, input().split()))
    ans = 0
    import itertools
    for x, y in itertools.combinations(D, 2):
        ans += x*y
    print(ans) resolve 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 ans = 0 ans 0 import itertools itertools for x, y in itertools.combinations(D, 2):
        ans += x*y
     x y itertools.combinations(D, 2) itertools.combinations itertools combinations D 2 ans += x*y ans x*y x y print(ans) print ans if '__main__' == __name__:
    resolve() '__main__' == __name__ '__main__' __name__ resolve() resolve def resolve():
    N = int(input())
    D = list(map(int, input().split()))
    ans = 0
    import itertools
    for x, y in itertools.combinations(D, 2):
        ans += x*y
    print(ans) def resolve():
    N = int(input())
    D = list(map(int, input().split()))
    ans = 0
    import itertools
    for x, y in itertools.combinations(D, 2):
        ans += x*y
    print(ans) resolve
def resolve():
    N = int(input())
    D = list(map(int, input().split()))
    ans = 0
    import itertools
    for x, y in itertools.combinations(D, 2):
        ans += x*y
    print(ans)

if '__main__' == __name__:
    resolve()