import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
l=list(mi())
s=0
t=0
for i in l:
  s+=i
  t+=i**2
print(int((s**2-t)/2)) import math math import sys sys from collections import deque import heapq heapq import copy copy import itertools itertools from itertools import permutations def mi() : return map(int,sys.stdin.readline().split()) mi def ii() : return int(sys.stdin.readline().rstrip()) ii def i() : return sys.stdin.readline().rstrip() i a=ii() a ii() ii l=list(mi()) l list(mi()) list mi() mi s=0 s 0 t=0 t 0 for i in l:
  s+=i
  t+=i**2 i l s+=i s i t+=i**2 t i**2 i 2 print(int((s**2-t)/2)) print int((s**2-t)/2) int (s**2-t)/2 s**2-t s**2 s 2 t 2 l=list(mi()) list(mi()) l t+=i**2 i**2 t def mi() : return map(int,sys.stdin.readline().split()) def mi() : return map(int,sys.stdin.readline().split()) mi t=0 0 t def ii() : return int(sys.stdin.readline().rstrip()) def ii() : return int(sys.stdin.readline().rstrip()) ii a=ii() ii() a s+=i i s def i() : return sys.stdin.readline().rstrip() def i() : return sys.stdin.readline().rstrip() i s=0 0 s
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
l=list(mi())
s=0
t=0
for i in l:
  s+=i
  t+=i**2
print(int((s**2-t)/2))