n, a, ans = int(raw_input()), map(int, raw_input().split()), 0
a.sort(); a.reverse()
for i in range(0, n, 2): ans += a[i]
print ans

4241ffde360a7e7a1b1d7f86dda781bde2f0f6e2
n, a, ans = int(raw_input()), map(int, raw_input().split()), 0
a.sort(); a.reverse()
for i in range(0, n, 2): ans += a[i]
print ans
