A =int(input()) B =list(map(int,input().split())) C = sorted(B) C.reverse() D = C[0::2] ans = 0 for i in D: ans = ans + i print(ans)