## https://yukicoder.me/problems/no/1564 def main(): N = int(input()) A = list(map(int, input().split())) A.sort() answer = 0 for i in range(N): a = A[2 * i] b = A[2 * i + 1] answer += a * b print(answer) if __name__ == '__main__': main()