import sys

import itertools





def solve():

    input = sys.stdin.readline

    mod = 10 ** 9 + 7

    n = int(input().rstrip('\n'))

    d = list(map(int, input().rstrip('\n').split()))

    t = 0

    for v in itertools.combinations(d, 2):

        t += (v[0] * v[1])

    print(t)





if __name__ == '__main__':

    solve()

import sys

import itertools





def solve():

    readline = sys.stdin.buffer.readline

    mod = 10 ** 9 + 7

    n = int(readline())

    a = list(map(int, readline().split()))

    t = 0

    for v in itertools.combinations(a, 2):

        t += v[0] * v[1]

    print(t)





if __name__ == '__main__':

    solve()

import sys
import itertools


def solve():
    input = sys.stdin.readline
    mod = 10**9 + 7
    n = int(input().rstrip("\n"))
    d = list(map(int, input().rstrip("\n").split()))
    t = 0
    for v in itertools.combinations(d, 2):
        t += v[0] * v[1]
    print(t)


if __name__ == "__main__":
    solve()

import sys
import itertools


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10**9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    t = 0
    for v in itertools.combinations(a, 2):
        t += v[0] * v[1]
    print(t)


if __name__ == "__main__":
    solve()

-    input = sys.stdin.readline +    readline = sys.stdin.buffer.readline -    n = int(input().rstrip("\n")) -    d = list(map(int, input().rstrip("\n").split())) +    n = int(readline()) +    a = list(map(int, readline().split())) -    for v in itertools.combinations(d, 2): +    for v in itertools.combinations(a, 2):