# -*- coding: utf-8 -*-
"""
B - TAKOYAKI FESTIVAL 2019
https://atcoder.jp/contests/abc143/tasks/abc143_b

"""
import sys


from itertools import combinations

def solve(takoyaki):
    return sum(x * y for x, y in combinations(takoyaki, 2))


def main(args):
    _ = input()
    takoyaki = map(int, input().split())
    ans = solve(takoyaki)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:]) """
B - TAKOYAKI FESTIVAL 2019
https://atcoder.jp/contests/abc143/tasks/abc143_b

""" import sys sys from itertools import combinations def solve(takoyaki):
    return sum(x * y for x, y in combinations(takoyaki, 2)) solve return sum(x * y for x, y in combinations(takoyaki, 2)) sum(x * y for x, y in combinations(takoyaki, 2)) sum x * y x y takoyaki takoyaki def main(args):
    _ = input()
    takoyaki = map(int, input().split())
    ans = solve(takoyaki)
    print(ans) main _ = input() _ input() input takoyaki = map(int, input().split()) takoyaki map(int, input().split()) map int input().split() ().split () input split ans = solve(takoyaki) ans solve(takoyaki) solve takoyaki print(ans) print ans args args if __name__ == '__main__':
    main(sys.argv[1:]) __name__ == '__main__' __name__ '__main__' main(sys.argv[1:]) main sys.argv[1:] sys.argv sys argv 1: 1 def solve(takoyaki):
    return sum(x * y for x, y in combinations(takoyaki, 2)) def solve(takoyaki):
    return sum(x * y for x, y in combinations(takoyaki, 2)) solve def main(args):
    _ = input()
    takoyaki = map(int, input().split())
    ans = solve(takoyaki)
    print(ans) def main(args):
    _ = input()
    takoyaki = map(int, input().split())
    ans = solve(takoyaki)
    print(ans) main
# -*- coding: utf-8 -*-
"""
B - TAKOYAKI FESTIVAL 2019
https://atcoder.jp/contests/abc143/tasks/abc143_b

"""
import sys


from itertools import combinations

def solve(takoyaki):
    return sum(x * y for x, y in combinations(takoyaki, 2))


def main(args):
    _ = input()
    takoyaki = map(int, input().split())
    ans = solve(takoyaki)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
