n = int(input())
list_d = [int(i) for i in input().split()]
ans = 0
for i in range(0, n - 1):
    ans += list_d[i] * sum(list_d[i + 1:])
print(ans) n = int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i list_d = [int(i) for i in input().split()] list_d [int(i) for i in input().split()] ans = 0 ans 0 for i in range(0, n - 1):
    ans += list_d[i] * sum(list_d[i + 1:]) i range(0, n - 1) range 0 n - 1 n 1 ans += list_d[i] * sum(list_d[i + 1:]) ans list_d[i] * sum(list_d[i + 1:]) list_d[i] list_d i sum(list_d[i + 1:]) sum list_d[i + 1:] list_d i + 1: i + 1 i 1 print(ans) print ans ans = 0 0 ans ans += list_d[i] * sum(list_d[i + 1:]) list_d[i] * sum(list_d[i + 1:]) ans list_d = [int(i) for i in input().split()] [int(i) for i in input().split()] list_d n = int(input()) int(input()) n
n = int(input())
list_d = [int(i) for i in input().split()]
ans = 0
for i in range(0, n - 1):
    ans += list_d[i] * sum(list_d[i + 1:])
print(ans)