def main():
    n = int(input())
    d = [int(x) for x in input().split()]
    ans = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                ans += d[i]*d[j]
    print(ans)

if __name__ == '__main__':
    main() def main():
    n = int(input())
    d = [int(x) for x in input().split()]
    ans = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                ans += d[i]*d[j]
    print(ans) main 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 i in range(n):
        for j in range(n):
            if i < j:
                ans += d[i]*d[j]
     i range(n) range n for j in range(n):
            if i < j:
                ans += d[i]*d[j]
     j range(n) range n if i < j:
                ans += d[i]*d[j]
     i < j i j ans += d[i]*d[j] ans d[i]*d[j] d[i] d i d[j] d j print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    d = [int(x) for x in input().split()]
    ans = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                ans += d[i]*d[j]
    print(ans) def main():
    n = int(input())
    d = [int(x) for x in input().split()]
    ans = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                ans += d[i]*d[j]
    print(ans) main
def main():
    n = int(input())
    d = [int(x) for x in input().split()]
    ans = 0
    for i in range(n):
        for j in range(n):
            if i < j:
                ans += d[i]*d[j]
    print(ans)

if __name__ == '__main__':
    main()