n = int(input()) a = list(map(int, input().split())) a.sort() k = (n // 2) + 1 print(sum(a[:k]))