(
1
+
2
+
3
)
2
=
1
2
+
2
2
+
3
2
+
2
∗
(
1
∗
2
+
1
∗
3
+
2
∗
3
)
(1+2+3)^2=1^2+2^2+3^2+2*(1*2+1*3+2*3)
(1+2+3)2=12+22+32+2∗(1∗2+1∗3+2∗3)
n = input()
a = list(map(int,input().split()))
s1 = sum(a) ** 2
s2 = 0
for i in a:
s2 += i ** 2
ans = (s1 - s2) // 2
print(ans)