from itertools import combinations

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

result = 0
for c in combinations(d, 2):
    result += c[0] * c[1]

print(result) from itertools import combinations N = int(input()) N int(input()) int input() input d = map(int, input().split()) d map(int, input().split()) map int input().split() ().split () input split result = 0 result 0 for c in combinations(d, 2):
    result += c[0] * c[1] c combinations(d, 2) combinations d 2 result += c[0] * c[1] result c[0] * c[1] c[0] c 0 c[1] c 1 print(result) print result d = map(int, input().split()) map(int, input().split()) d result += c[0] * c[1] c[0] * c[1] result N = int(input()) int(input()) N result = 0 0 result
from itertools import combinations

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

result = 0
for c in combinations(d, 2):
    result += c[0] * c[1]

print(result)
