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