import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    D=list(mi())

    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 sys.setrecursionlimit(10**9) sys.setrecursionlimit sys setrecursionlimit 10**9 10 9 def mi(): return map(int,input().split()) mi def ii(): return int(input()) ii def isp(): return input().split() isp def deb(text): print("-------\n{}\n-------".format(text)) deb text text INF=10**20 INF 10**20 10 20 def main():
    N=ii()
    D=list(mi())

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

    print(ans) main N=ii() N ii() ii D=list(mi()) D list(mi()) list mi() mi 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 INF=10**20 10**20 INF def mi(): return map(int,input().split()) def mi(): return map(int,input().split()) mi def ii(): return int(input()) def ii(): return int(input()) ii def isp(): return input().split() def isp(): return input().split() isp def deb(text): print("-------\n{}\n-------".format(text)) def deb(text): print("-------\n{}\n-------".format(text)) deb def main():
    N=ii()
    D=list(mi())

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

    print(ans) def main():
    N=ii()
    D=list(mi())

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

    print(ans) main
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    D=list(mi())

    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()