input() print(sum(x * y for x, y in zip(*[iter(sorted(map(int, input().split())))] * 2)))