#!/usr/bin python3
# -*- coding: utf-8 -*-

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

if __name__ == '__main__':
    main() def main():
    N = int(input())
    d = list(map(int, input().split()))
    ret = 0
    for i in range(N):
        for j in range(i+1,N):
            ret += d[i]*d[j]
    print(ret) 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 ret = 0 ret 0 for i in range(N):
        for j in range(i+1,N):
            ret += d[i]*d[j]
     i range(N) range N for j in range(i+1,N):
            ret += d[i]*d[j]
     j range(i+1,N) range i+1 i 1 N ret += d[i]*d[j] ret d[i]*d[j] d[i] d i d[j] d j print(ret) print ret if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N = int(input())
    d = list(map(int, input().split()))
    ret = 0
    for i in range(N):
        for j in range(i+1,N):
            ret += d[i]*d[j]
    print(ret) def main():
    N = int(input())
    d = list(map(int, input().split()))
    ret = 0
    for i in range(N):
        for j in range(i+1,N):
            ret += d[i]*d[j]
    print(ret) main
#!/usr/bin python3
# -*- coding: utf-8 -*-

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

if __name__ == '__main__':
    main()