from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n = int(input())
    d = list(map(int, input().split()))
    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            ans += d[i] * d[j]

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main() from sys import stdin, setrecursionlimit def main():
    input = stdin.buffer.readline
    n = int(input())
    d = list(map(int, input().split()))
    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            ans += d[i] * d[j]

    print(ans) main input = stdin.buffer.readline input stdin.buffer.readline stdin.buffer stdin buffer readline 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 for i in range(n - 1):
        for j in range(i + 1, n):
            ans += d[i] * d[j]

     i range(n - 1) range n - 1 n 1 for j in range(i + 1, n):
            ans += d[i] * d[j]

     j range(i + 1, n) range i + 1 i 1 n ans += d[i] * d[j] ans d[i] * d[j] d[i] d i d[j] d j print(ans) print ans if __name__ == "__main__":
    setrecursionlimit(10000)
    main() __name__ == "__main__" __name__ "__main__" setrecursionlimit(10000) setrecursionlimit 10000 main() main def main():
    input = stdin.buffer.readline
    n = int(input())
    d = list(map(int, input().split()))
    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            ans += d[i] * d[j]

    print(ans) def main():
    input = stdin.buffer.readline
    n = int(input())
    d = list(map(int, input().split()))
    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            ans += d[i] * d[j]

    print(ans) main
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n = int(input())
    d = list(map(int, input().split()))
    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            ans += d[i] * d[j]

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
