n=int(input()) ns=list(map(int,input().split())) ns.sort(reverse=True) cnt=0 for i in range(1,n*2,2): cnt+=ns[i]*ns[i-1] print(cnt)