import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9
import itertools

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

    C = itertools.combinations(D, 2)
    ans = 0
    for c in C:
        ans += c[0]*c[1]

    print(ans)



if __name__ == '__main__':
    main() import sys sys sys.setrecursionlimit(4100000) sys.setrecursionlimit sys setrecursionlimit 4100000 import math math INF = 10**9 INF 10**9 10 9 import itertools itertools def main():
    n = int(input())
    D = list(map(int, input().split()))

    C = itertools.combinations(D, 2)
    ans = 0
    for c in C:
        ans += c[0]*c[1]

    print(ans) main 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 C = itertools.combinations(D, 2) C itertools.combinations(D, 2) itertools.combinations itertools combinations D 2 ans = 0 ans 0 for c in C:
        ans += c[0]*c[1]

     c C ans += c[0]*c[1] ans c[0]*c[1] c[0] c 0 c[1] c 1 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    D = list(map(int, input().split()))

    C = itertools.combinations(D, 2)
    ans = 0
    for c in C:
        ans += c[0]*c[1]

    print(ans) def main():
    n = int(input())
    D = list(map(int, input().split()))

    C = itertools.combinations(D, 2)
    ans = 0
    for c in C:
        ans += c[0]*c[1]

    print(ans) main INF = 10**9 10**9 INF
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9
import itertools

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

    C = itertools.combinations(D, 2)
    ans = 0
    for c in C:
        ans += c[0]*c[1]

    print(ans)



if __name__ == '__main__':
    main()
