import sys


# input = sys.stdin.readline

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



    print(int(ans/2))

if __name__ == "__main__":
    main() import sys sys def main():
    N = int(input())
    d = list(map(int,input().split()))
    ans = 0
    for i in range(N):
        for j in range(N):
            if i !=j:
                ans += d[i]*d[j]



    print(int(ans/2)) 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(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(int(ans/2)) print int(ans/2) int ans/2 ans 2 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N = int(input())
    d = list(map(int,input().split()))
    ans = 0
    for i in range(N):
        for j in range(N):
            if i !=j:
                ans += d[i]*d[j]



    print(int(ans/2)) def main():
    N = int(input())
    d = list(map(int,input().split()))
    ans = 0
    for i in range(N):
        for j in range(N):
            if i !=j:
                ans += d[i]*d[j]



    print(int(ans/2)) main
import sys


# input = sys.stdin.readline

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



    print(int(ans/2))

if __name__ == "__main__":
    main()