Go: package main

import "fmt"

func main() {

     for ; true ; {
     var n int
     fmt.Scan(&n)
     if n == 0 { break }
     a := make([]float64, n)
     var sum float64 = 0
     for i := 0; i < n; i++ {
     	 fmt.Scan(&a[i])
	 sum += float64(a[i])
     }
     sum /= float64(n)
     ans := 0
     for i := 0; i < n; i++ {
     	 if a[i] <= sum {
	    ans += 1
	 }
     }
     fmt.Println(ans)
     }
}

Python: #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    while 1:
        n = I()
        if n == 0:
            quit()
        a = LI()
        m = sum(a)/n
        c = 0
        for i in range(n):
            if a[i] <= m:
                c += 1
        print(c)
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#I
def I_():
    return

#J
def J():
    return

#Solve
if __name__ == "__main__":
    A()

Python: # coding: utf-8
# Your code here!

while True:
   n = int(input()) # 国民の人数
   if n == 0: break
   
   income = list(map(int, input().split()))
   avg = sum(income) // n
   
   c = 0
   for i in range(n):
      if income[i] <= avg:
         c += 1
   print(c)

Python: while True:
  n = int(input())
  if n == 0:break
  alst = list(map(int, input().split()))
  ave = sum(alst) / n
  print(sum(a <= ave for a in alst))

Python: while 1:
    n = int(input())
    if n == 0:
        break
    a = list(map(int,input().split()))
    cnt = 0
    ave = sum(a) / n
    for i in a:
        if ave >= i:
           cnt +=1
    print(cnt)

Python: while True:
    n = int(input())
    if n == 0:
        exit()
    else:
        sample = list(map(int,input().split()))
        average = sum(sample)/n
        cnt = len([1 for i in range(n) if sample[i] <= average])
        print(cnt)

Python: while True:
    n = int(input());
    if n == 0:
        break;
    a = list(map(int, input().split()));

    h = sum(a)/n;
    
    k = 0;
    for i in range(0,n):
        if a[i] <= h:
            k += 1;
    print(k);

Python: a = int(input())
su = 0
while a != 0:
    b = list(map(int,input().split()))
    c = sum(b)/len(b)
    for i in range(len(b)):
        if b[i] <= c:
            su += 1
    
    print(su)
    su = 0
    a = int(input())

Python: while True:
    n = int(input())
    if n == 0:
        break;
    a = list(map(int, input().split()))
    mean = sum(a)/n
    print(len(list(filter(lambda x:x<=mean, a))))

Python: while True:
	n = int(input())
	if n < 1:
		break
	data = [int(x) for x in input().split()]
	lessequal = [1 for x in data if x <= (sum(data) / len(data))]
	print(sum(lessequal))

Python: while True:
  n=int(input())
  c=0
  if n==0:
    break
  ns=list(map(int, input().split()))
  for i in range(n):
    if ns[i]<=sum(ns)/n:
      c+=1
  print(c)

Python: while True :
    n = int(input())
    if n == 0 :
        break
    
    lst = list(map(int, input().split()))
    ave_lst = sum(lst) / len(lst)
    Sum = 0
    for i in range(n) :
        if lst[i] <= ave_lst :
            Sum += 1
    print(Sum)

Python: x=[]
a=[] #appendのために宣言が必要
while True:
    try:
        a.append(list(map(int,input().split())))

    except:
        break;
        #または、quit(),os.exit()をして止める。


#[[1, 2, 2, 3, 1], [4, 5, 3, 4, 1, 2, 3, 4], [2, 3, 5, 6, 0, 2]]
for i in range(len(a)//2):
    x.append(i)
    n=i*2
    m=i*2+1
    s=sum(a[m])/a[n][0]
    for t in range(len(a[m])):
      if s>=a[m][t]:
        x[i]=x[i]+1
    print(x[i]-i)

Python: import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    def f(n):
        a = LI()
        av = 1.0 * sum(a) / n

        return len([c for c in a if c <= av])


    while 1:
        n = I()
        if n == 0:
            break
        rr.append(f(n))

    return '\n'.join(map(str, rr))


print(main())

Python: while True:
    n=int(input())
    if n==0:
        break
    a=list(map(int,input().split()))
    
    c=0
    ave=0
    for i in range(n):
        ave=ave+a[i]
    ave=ave//n
    for i in range(n):
        if ave>=a[i]:
            c=c+1
    
    print(c)

Python: from statistics import mean
while True:
  n=int(input())
  c=0
  if n==0:
    break
  ns=list(map(int, input().split()))
  for i in range(n):
    if ns[i]<=mean(ns):
      c+=1
    else:
      pass
  print(c)

Python: while True:
   n = int(input())
   if n==0:
      break
   a = [int(x) for x in input().split()]
   ave = sum(a)/n
   c = 0
   for j in range(n):
      if a[j]<=ave:
         c += 1
   print(c)

Python: from statistics import mean
while True:
  n=int(input())
  c=0
  if n==0:
    break
  ns=list(map(int, input().split()))
  for i in range(n):
    if ns[i]<=mean(ns):
      c+=1
  print(c)

Python: nl=[]
al=[]
while 1:
    n=input()
    if n=="0":
        break
    nl.append(int(n))

    a = list(map(lambda x: int(x), input().split()))
    al.append(a)

for i in range(len(nl)):
    ave = sum(al[i]) / nl[i]
    num = len(list(filter(lambda x: x <= ave, al[i])))
    print(num)

Python: while True :
    n=int(input())
    if n==0 : break
    a=input().split()
    tot=0;ans=0
    for i in a : tot+=int(i)
    for i in a :
        if (tot/n)>=int(i) : ans+=1
    print(ans)

Python: def solve(N, A):
    m = sum(A) / N
    ans = 0
    for i in range(N):
        if A[i] <= m:
            ans += 1
    print(ans)

while True:
    N = int(input())
    if N == 0:
        break
    A = list(map(int, input().split()))
    solve(N, A)

Python: try:
    while True:
        n = int(input())
        if n == 0:
            break
        ika = 0
        a = list(map(int,input().split()))
        m = sum(a) / n
        for j in a:
            if j <= m:
                ika += 1 
        print(ika)
except EOFError:
    pass

Python: while True:
	n = int(input())
	if n == 0:
	    break
	a = list(map(int, input().split()))
	s = int(sum(a) // n)
	ans = 0
	for x in a:
	    if x <= s:
	        ans += 1
	print(ans)

Python: while(1):
	n=int(input())
	if n==0:
		break	
	a=[int(i) for i in input().split()]

	total=0
	for i in a:
		total+=i
	
	hei=total/n
	count=0
	for i in a:
		if i <=hei:
			count+=1
	print(count)

Python: from itertools import takewhile

while True:
    n = int(input())
    if n == 0:break
    num = sorted(list(map(int, input().split())))
    ave = int(sum(num))/int(len(num))
    print(len(list(takewhile (lambda x:x <= ave, num))))