N=int(input()) A=list(map(int,input().split())) B=sorted(A) X=0 for k in range(N): X+=B[2*k]*B[2*k+1] print(X)