# -*- coding: utf-8 -*-

def main():

    N = int(input())
    d = list(map(int, input().split()))

    ans = 0

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

    print(ans)


if __name__ == "__main__":
    main() def main():

    N = int(input())
    d = list(map(int, input().split()))

    ans = 0

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

    print(ans) 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 - 1):
        for j in range(i + 1, N):
            ans += d[i] * d[j]

     i range(N - 1) range N - 1 N 1 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 def main():

    N = int(input())
    d = list(map(int, input().split()))

    ans = 0

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

    print(ans) def main():

    N = int(input())
    d = list(map(int, input().split()))

    ans = 0

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

    print(ans) main
# -*- coding: utf-8 -*-

def main():

    N = int(input())
    d = list(map(int, input().split()))

    ans = 0

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

    print(ans)


if __name__ == "__main__":
    main()