n=int(eval(input()))

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

a=sorted(a)



import numpy as np

cum=list(np.cumsum(a))



cnt=0

for i in range(n-1,-1,-1):

    if i==n-1:

        cnt+=1

        continue



    if 2*cum[i]>=a[i+1]:

        cnt+=1

    else:

        break



print(cnt) 



n=int(eval(input()))

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



import numpy as np



a=sorted(a)

cum = np.cumsum(a)



cum=list(reversed(cum))

a=list(reversed(a))

ans=1

for i in range(1,n):

    if a[i-1]<=cum[i]*2:

        ans+=1

    else:

        break



print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
a = sorted(a)
import numpy as np

cum = list(np.cumsum(a))
cnt = 0
for i in range(n - 1, -1, -1):
    if i == n - 1:
        cnt += 1
        continue
    if 2 * cum[i] >= a[i + 1]:
        cnt += 1
    else:
        break
print(cnt)

n = int(eval(input()))
a = list(map(int, input().split()))
import numpy as np

a = sorted(a)
cum = np.cumsum(a)
cum = list(reversed(cum))
a = list(reversed(a))
ans = 1
for i in range(1, n):
    if a[i - 1] <= cum[i] * 2:
        ans += 1
    else:
        break
print(ans)

-a = sorted(a) -cum = list(np.cumsum(a)) -cnt = 0 -for i in range(n - 1, -1, -1): -    if i == n - 1: -        cnt += 1 -        continue -    if 2 * cum[i] >= a[i + 1]: -        cnt += 1 +a = sorted(a) +cum = np.cumsum(a) +cum = list(reversed(cum)) +a = list(reversed(a)) +ans = 1 +for i in range(1, n): +    if a[i - 1] <= cum[i] * 2: +        ans += 1 -print(cnt) +print(ans)