import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

def main():
    n = int(input())
    d = list(map(int, input().split()))
    sum = 0
    for i in range(n-1):
        for k in range(i+1,n):
            sum += d[i]*d[k]
    print(sum)
    
    
main() import sys sys import decimal decimal def input():
    return sys.stdin.readline().strip() input return sys.stdin.readline().strip() sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip def main():
    n = int(input())
    d = list(map(int, input().split()))
    sum = 0
    for i in range(n-1):
        for k in range(i+1,n):
            sum += d[i]*d[k]
    print(sum)
    
     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 sum = 0 sum 0 for i in range(n-1):
        for k in range(i+1,n):
            sum += d[i]*d[k]
     i range(n-1) range n-1 n 1 for k in range(i+1,n):
            sum += d[i]*d[k]
     k range(i+1,n) range i+1 i 1 n sum += d[i]*d[k] sum d[i]*d[k] d[i] d i d[k] d k print(sum) print sum main() main def input():
    return sys.stdin.readline().strip() def input():
    return sys.stdin.readline().strip() input def main():
    n = int(input())
    d = list(map(int, input().split()))
    sum = 0
    for i in range(n-1):
        for k in range(i+1,n):
            sum += d[i]*d[k]
    print(sum)
    
     def main():
    n = int(input())
    d = list(map(int, input().split()))
    sum = 0
    for i in range(n-1):
        for k in range(i+1,n):
            sum += d[i]*d[k]
    print(sum)
    
     main
import sys
import decimal # 10進法に変換，正確な計算

def input():
    return sys.stdin.readline().strip()

def main():
    n = int(input())
    d = list(map(int, input().split()))
    sum = 0
    for i in range(n-1):
        for k in range(i+1,n):
            sum += d[i]*d[k]
    print(sum)
    
    
main()
