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