import itertools

def main():
    N = input()
    D = map(int, input().split())
    ans = 0
    for v in itertools.combinations(D, 2):
        ans += v[0] * v[1]
    print(ans)


if __name__ == '__main__':
    main() import itertools itertools def main():
    N = input()
    D = map(int, input().split())
    ans = 0
    for v in itertools.combinations(D, 2):
        ans += v[0] * v[1]
    print(ans) main N = input() N input() input D = map(int, input().split()) D map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for v in itertools.combinations(D, 2):
        ans += v[0] * v[1]
     v itertools.combinations(D, 2) itertools.combinations itertools combinations D 2 ans += v[0] * v[1] ans v[0] * v[1] v[0] v 0 v[1] v 1 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N = input()
    D = map(int, input().split())
    ans = 0
    for v in itertools.combinations(D, 2):
        ans += v[0] * v[1]
    print(ans) def main():
    N = input()
    D = map(int, input().split())
    ans = 0
    for v in itertools.combinations(D, 2):
        ans += v[0] * v[1]
    print(ans) main
import itertools

def main():
    N = input()
    D = map(int, input().split())
    ans = 0
    for v in itertools.combinations(D, 2):
        ans += v[0] * v[1]
    print(ans)


if __name__ == '__main__':
    main()
