n = int(eval(input()))



from itertools import accumulate

a = sorted(map(int, input().split()))

acc = list(accumulate(a))[::-1]

a = a[::-1]

ans = 1

for i in range(n-1):

    if acc[i] > a[i+1]*2 and a[i] > acc[i+1]*2:

        break

    ans += 1

print(ans)

n = int(eval(input()))

a = sorted(map(int, input().split()))



acc = 0

ans = 0



for i in range(n):

    if acc * 2 >= a[i]:

        ans += 1

    else:

        ans = 1

    acc += a[i]



print(ans)



n = int(eval(input()))
from itertools import accumulate

a = sorted(map(int, input().split()))
acc = list(accumulate(a))[::-1]
a = a[::-1]
ans = 1
for i in range(n - 1):
    if acc[i] > a[i + 1] * 2 and a[i] > acc[i + 1] * 2:
        break
    ans += 1
print(ans)

n = int(eval(input()))
a = sorted(map(int, input().split()))
acc = 0
ans = 0
for i in range(n):
    if acc * 2 >= a[i]:
        ans += 1
    else:
        ans = 1
    acc += a[i]
print(ans)

-from itertools import accumulate - -acc = list(accumulate(a))[::-1] -a = a[::-1] -ans = 1 -for i in range(n - 1): -    if acc[i] > a[i + 1] * 2 and a[i] > acc[i + 1] * 2: -        break -    ans += 1 +acc = 0 +ans = 0 +for i in range(n): +    if acc * 2 >= a[i]: +        ans += 1 +    else: +        ans = 1 +    acc += a[i]