N=input() p=sorted(map(int,input().split())) m=sum(a*b for a,b in zip(p[0::2],p[1::2])) print(m)