def main():
    n = int(input())
    d_lst = list(map(int, input().split()))
    ans = 0

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

    print(ans)


if __name__ == "__main__":
    main() def main():
    n = int(input())
    d_lst = list(map(int, input().split()))
    ans = 0

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

    print(ans) main n = int(input()) n int(input()) int input() input d_lst = list(map(int, input().split())) d_lst 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_lst[i] * d_lst[j]

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

     j range(i + 1, n) range i + 1 i 1 n ans += d_lst[i] * d_lst[j] ans d_lst[i] * d_lst[j] d_lst[i] d_lst i d_lst[j] d_lst j print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    d_lst = list(map(int, input().split()))
    ans = 0

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

    print(ans) def main():
    n = int(input())
    d_lst = list(map(int, input().split()))
    ans = 0

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

    print(ans) main
def main():
    n = int(input())
    d_lst = list(map(int, input().split()))
    ans = 0

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

    print(ans)


if __name__ == "__main__":
    main()
