n = int(input()) array = [int(x) for x in input().split()] array = sorted(array, reverse=True) sum = 0 for i in range(n): sum += array[2*i] * array[i*2+1] print(sum)