n=int(input()) a=list(map(int,input().split())) a.sort(reverse=True) print(sum(a[i] for i in range(0,n,2)))