n = int(input()) A = sorted(list(map(int,input().split()))) S = 0 for i in range(n): S += A[i*2] * A[i*2+1] print(S)