import itertools
import functools
import operator
pi = functools.partial(functools.reduce, operator.mul)


def solve():
    N = int(input())
    d = [int(x) for x in input().split()]
    ans = 0
    for c in itertools.combinations(d, 2):
        # print(c)
        ans += pi(c)
    print(ans)


if __name__ == "__main__":
    solve() import itertools itertools import functools functools import operator operator pi = functools.partial(functools.reduce, operator.mul) pi functools.partial(functools.reduce, operator.mul) functools.partial functools partial functools.reduce functools reduce operator.mul operator mul def solve():
    N = int(input())
    d = [int(x) for x in input().split()]
    ans = 0
    for c in itertools.combinations(d, 2):
        # print(c)
        ans += pi(c)
    print(ans) solve N = int(input()) N int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x d = [int(x) for x in input().split()] d [int(x) for x in input().split()] ans = 0 ans 0 for c in itertools.combinations(d, 2):
        # print(c)
        ans += pi(c)
     c itertools.combinations(d, 2) itertools.combinations itertools combinations d 2 ans += pi(c) ans pi(c) pi c print(ans) print ans if __name__ == "__main__":
    solve() __name__ == "__main__" __name__ "__main__" solve() solve pi = functools.partial(functools.reduce, operator.mul) functools.partial(functools.reduce, operator.mul) pi def solve():
    N = int(input())
    d = [int(x) for x in input().split()]
    ans = 0
    for c in itertools.combinations(d, 2):
        # print(c)
        ans += pi(c)
    print(ans) def solve():
    N = int(input())
    d = [int(x) for x in input().split()]
    ans = 0
    for c in itertools.combinations(d, 2):
        # print(c)
        ans += pi(c)
    print(ans) solve
import itertools
import functools
import operator
pi = functools.partial(functools.reduce, operator.mul)


def solve():
    N = int(input())
    d = [int(x) for x in input().split()]
    ans = 0
    for c in itertools.combinations(d, 2):
        # print(c)
        ans += pi(c)
    print(ans)


if __name__ == "__main__":
    solve()