N = int(input()) A = list(map(int, input().split())) A.sort(reverse=True) k = 0 i = 0 cnt = 0 ans = 0 while i