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