import sys
import itertools
input = lambda: sys.stdin.readline().rstrip()


def solve():
    N = int(input())
    d = list(map(int, input().split()))

    comb = list(itertools.combinations(range(N), 2))
    ans = 0
    for c in comb:
        i1, i2 = c
        ans += d[i1] * d[i2]

    print(ans)


if __name__ == '__main__':
    solve() import sys sys import itertools itertools input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def solve():
    N = int(input())
    d = list(map(int, input().split()))

    comb = list(itertools.combinations(range(N), 2))
    ans = 0
    for c in comb:
        i1, i2 = c
        ans += d[i1] * d[i2]

    print(ans) solve 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 comb = list(itertools.combinations(range(N), 2)) comb list(itertools.combinations(range(N), 2)) list itertools.combinations(range(N), 2) itertools.combinations itertools combinations range(N) range N 2 ans = 0 ans 0 for c in comb:
        i1, i2 = c
        ans += d[i1] * d[i2]

     c comb i1, i2 = c i1 c i2 ans += d[i1] * d[i2] ans d[i1] * d[i2] d[i1] d i1 d[i2] d i2 print(ans) print ans if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input def solve():
    N = int(input())
    d = list(map(int, input().split()))

    comb = list(itertools.combinations(range(N), 2))
    ans = 0
    for c in comb:
        i1, i2 = c
        ans += d[i1] * d[i2]

    print(ans) def solve():
    N = int(input())
    d = list(map(int, input().split()))

    comb = list(itertools.combinations(range(N), 2))
    ans = 0
    for c in comb:
        i1, i2 = c
        ans += d[i1] * d[i2]

    print(ans) solve
import sys
import itertools
input = lambda: sys.stdin.readline().rstrip()


def solve():
    N = int(input())
    d = list(map(int, input().split()))

    comb = list(itertools.combinations(range(N), 2))
    ans = 0
    for c in comb:
        i1, i2 = c
        ans += d[i1] * d[i2]

    print(ans)


if __name__ == '__main__':
    solve()
