#!/usr/bin/env python

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**6)
INF = float("inf")

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

    ans = 0
    for i in range(N):
        for j in range(i+1,N):
            ans += D[i]*D[j]
    
    print(ans)

if __name__ == "__main__":
    main() import sys sys input = sys.stdin.buffer.readline input sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 INF = float("inf") INF float("inf") float "inf" def main():
    N = int(input())
    D = list(map(int,input().split()))

    ans = 0
    for i in range(N):
        for j in range(i+1,N):
            ans += D[i]*D[j]
    
    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 ans = 0 ans 0 for i in range(N):
        for j in range(i+1,N):
            ans += D[i]*D[j]
    
     i range(N) range N for j in range(i+1,N):
            ans += D[i]*D[j]
    
     j range(i+1,N) range i+1 i 1 N 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 input = sys.stdin.buffer.readline sys.stdin.buffer.readline input def main():
    N = int(input())
    D = list(map(int,input().split()))

    ans = 0
    for i in range(N):
        for j in range(i+1,N):
            ans += D[i]*D[j]
    
    print(ans) def main():
    N = int(input())
    D = list(map(int,input().split()))

    ans = 0
    for i in range(N):
        for j in range(i+1,N):
            ans += D[i]*D[j]
    
    print(ans) main INF = float("inf") float("inf") INF
#!/usr/bin/env python

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**6)
INF = float("inf")

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

    ans = 0
    for i in range(N):
        for j in range(i+1,N):
            ans += D[i]*D[j]
    
    print(ans)

if __name__ == "__main__":
    main()