

def paku(N, A, mid):

    if mid == 0:

        return False



    size = sum(A[:mid])



    for i in range(mid, N):

        if A[i] <= 2*size:

            size += A[i]

        else:

            return False



    return True





N = int(eval(input()))

A = [int(i) for i in input().split()]

A.sort()



top = N

btm = 0



while top - btm > 1:

    mid = (top + btm) // 2



    if paku(N, A, mid):

        top = mid

    else:

        btm = mid



ans = N - top + 1



print(ans)


N = int(eval(input()))

A = [int(i) for i in input().split()]

A.sort()



l = 0

size = 0



for i in range(N - 1):

    size += A[i]



    if A[i + 1] > 2 * size:

        l = i + 1



ans = N - l



print(ans)
def paku(N, A, mid):
    if mid == 0:
        return False
    size = sum(A[:mid])
    for i in range(mid, N):
        if A[i] <= 2 * size:
            size += A[i]
        else:
            return False
    return True


N = int(eval(input()))
A = [int(i) for i in input().split()]
A.sort()
top = N
btm = 0
while top - btm > 1:
    mid = (top + btm) // 2
    if paku(N, A, mid):
        top = mid
    else:
        btm = mid
ans = N - top + 1
print(ans)

N = int(eval(input()))
A = [int(i) for i in input().split()]
A.sort()
l = 0
size = 0
for i in range(N - 1):
    size += A[i]
    if A[i + 1] > 2 * size:
        l = i + 1
ans = N - l
print(ans)

-def paku(N, A, mid): -    if mid == 0: -        return False -    size = sum(A[:mid]) -    for i in range(mid, N): -        if A[i] <= 2 * size: -            size += A[i] -        else: -            return False -    return True - - -top = N -btm = 0 -while top - btm > 1: -    mid = (top + btm) // 2 -    if paku(N, A, mid): -        top = mid -    else: -        btm = mid -ans = N - top + 1 +l = 0 +size = 0 +for i in range(N - 1): +    size += A[i] +    if A[i + 1] > 2 * size: +        l = i + 1 +ans = N - l