n = int(eval(input()))

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



a.sort()

acum = [0] * (n+1)

for i in range(n):

    acum[i+1] += acum[i] + a[i]



ans = 1



for i in reversed(list(range(1, n))):

    if a[i] <= 2 * acum[i]:

        ans += 1

    else:

        break



print(ans)
n = int(eval(input()))

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



a.sort()

acum = [0] * (n+1)



# 累積和は0を含んだ0-basedの半開区間でかく(1-indexed)

for i in range(n):

    acum[i+1] += acum[i] + a[i]



ans = 1  # i = n-1 の時は必ず全て取り込めるので省いておく



for i in reversed(list(range(n-1))):

    if a[i+1] <= 2 * acum[i+1]:

        ans += 1

    else:

        break



print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
acum = [0] * (n + 1)
for i in range(n):
    acum[i + 1] += acum[i] + a[i]
ans = 1
for i in reversed(list(range(1, n))):
    if a[i] <= 2 * acum[i]:
        ans += 1
    else:
        break
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
acum = [0] * (n + 1)
# 累積和は0を含んだ0-basedの半開区間でかく(1-indexed)
for i in range(n):
    acum[i + 1] += acum[i] + a[i]
ans = 1  # i = n-1 の時は必ず全て取り込めるので省いておく
for i in reversed(list(range(n - 1))):
    if a[i + 1] <= 2 * acum[i + 1]:
        ans += 1
    else:
        break
print(ans)

+# 累積和は0を含んだ0-basedの半開区間でかく(1-indexed) -ans = 1 -for i in reversed(list(range(1, n))): -    if a[i] <= 2 * acum[i]: +ans = 1  # i = n-1 の時は必ず全て取り込めるので省いておく +for i in reversed(list(range(n - 1))): +    if a[i + 1] <= 2 * acum[i + 1]: