import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    D = list(map(int, input().split()))

    res = 0
    for i in range(n):
        for j in range(i + 1, n):
           res += D[i] * D[j]
    print(res)


if __name__ == '__main__':
    resolve() import sys sys sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline f_inf = float('inf') f_inf float('inf') float 'inf' mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 def resolve():
    n = int(input())
    D = list(map(int, input().split()))

    res = 0
    for i in range(n):
        for j in range(i + 1, n):
           res += D[i] * D[j]
    print(res) 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 res = 0 res 0 for i in range(n):
        for j in range(i + 1, n):
           res += D[i] * D[j]
     i range(n) range n for j in range(i + 1, n):
           res += D[i] * D[j]
     j range(i + 1, n) range i + 1 i 1 n res += D[i] * D[j] res D[i] * D[j] D[i] D i D[j] D j print(res) print res if __name__ == '__main__':
    resolve() __name__ == '__main__' __name__ '__main__' resolve() resolve mod = 10 ** 9 + 7 10 ** 9 + 7 mod input = sys.stdin.readline sys.stdin.readline input def resolve():
    n = int(input())
    D = list(map(int, input().split()))

    res = 0
    for i in range(n):
        for j in range(i + 1, n):
           res += D[i] * D[j]
    print(res) def resolve():
    n = int(input())
    D = list(map(int, input().split()))

    res = 0
    for i in range(n):
        for j in range(i + 1, n):
           res += D[i] * D[j]
    print(res) resolve f_inf = float('inf') float('inf') f_inf
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    D = list(map(int, input().split()))

    res = 0
    for i in range(n):
        for j in range(i + 1, n):
           res += D[i] * D[j]
    print(res)


if __name__ == '__main__':
    resolve()
