#yuki1564 n=int(input()) a=list(map(int,input().split())) b=sorted(a) res=0 for i in range(n): res+=b[2*i]*b[2*i+1] print(res)