Problem:
Income Inequality We often compute the average as the first step
in processing statistical data.
Yes, the average is a good tendency measure of data,
but it is not always the best.
In some cases, the average may hinder the understanding
of the data. For example, consider the national income of a country.
As the term income inequality suggests,
a small number of people earn a good portion of the gross national income
in many countries.
In such cases, the average income computes much higher than the
income of the vast majority.
It is not appropriate to regard the average as the income of typical people. Let us observe the above-mentioned phenomenon in some concrete data.
Incomes of n people, a 1 , ... , a n , are given.
You are asked to write a program that reports the number of people
whose incomes are less than or equal to the average
( a 1 + ... + a n ) / n . Input The input consists of multiple datasets, each in the following format.   n  a 1  a 2 ... a n   A dataset consists of two lines.
In the first line, the number of people n is given. n is an integer satisfying 2 ≤ n ≤ 10 000.
In the second line, incomes of n people are given. a i (1 ≤ i ≤ n ) is the income
of the i -th person.
This value is an integer greater than or equal to 1 and
less than or equal to 100 000. The end of the input is indicated by a line containing a zero.
The sum of n 's of all the datasets does not exceed 50 000. Output For each dataset, output the number of people whose incomes are
less than or equal to the average. Sample Input 7
15 15 15 15 15 15 15
4
10 20 30 60
10
1 1 1 1 1 1 1 1 1 100
7
90 90 90 90 90 90 10
7
2 7 1 8 2 8 4
0 Output for the Sample Input 7
3
9
1
4

Solution (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())

Solution (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)

Solution (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)

Solution (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))))

Solution (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))

Solution (Python):
anslist = []

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

    anslist.append(ans)

for i in anslist:
    print(i)

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

Solution (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)

Solution (Python):

while True:
    a = 0
    num = int(input())

    if num == 0: break

    ls = list(map(int,input().split()))
    ave = sum(ls) / num
    

    for i in range(num):
        if ls[i] <= ave :
            a += 1
    print(a)

Solution (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);

Solution (Python):

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

Solution (Python):
while True:
    t=[]
    n=int(input())
    if n==0:
        break
    else:
        m=input().strip().split()
        k=[int(i) for i in m]
        x=sum(k)/n
        for i in range(n):
            if k[i]<=x:
                t.append(k[i])
            else:
                pass
        print(len(t))

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

    sum_a = sum(a)
    ans = 0
    for e in a:
        if e * n <= sum_a:
            ans += 1
    print(ans)

Solution (Python):
while True:
    n=int(input())
    if n==0:
        break
    m=list(map(int,input().split()))
    M=sum(m)//n
    A=0
    for i in range(n):
        S=m[i]-M
        if S<=0:
            A=A+1
    print(A)

Solution (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)

Solution (Python):
while True:
    n=int(input())
    if n==0:
        break
    l=(input().split())
    for i in range(n):
        l[i]=int(l[i])
    m=sum(l)/n
    a=0
    for i in range(n):
        if l[i]<=m:
           a+=1
    print(a)

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

Solution (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)

Solution (Python):
ans = []
while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    avg = sum(a) / n
    ans.append(sum(avg >= x for x in a))
print(*ans, sep="\n")

Solution (Python):
ans = []
while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    avg = sum(a) / n
    ans.append(sum(avg >= x for x in a))
print(*ans, sep="\n")

Solution (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

Solution (Python):

while 1:
    n = int(input())
    if n==0: break
    a = list(map(int, input().split()))
    
    ave = sum(a)/n
    
    print(len([i for i in a if i <= ave]))

Solution (Python):
while True:
    M=0
    
    A=int(input())
    
    if A==0:
        break
    
    L=list(map(int,input().split()))
    
    B=sum(L)/len(L)
    
    for i in range(A):
        if L[i]<=B:
            M+=1
            
    print(M)

Solution (Python):
while True:
    a=int(input())
    if a==0:
        break
    else:
        b=list(map(int,input().split()))
        h=sum(b)/a
        c=0
        for i in range(a):
            if h>=b[i]:
                c+=1
            else:
                pass
        print(c)

Solution (Python):
while True:
    n=int(input())
    if n==0:
        break
    else:
        X=[int(i) for i in input().split()]
        a=sum(X)/n
        s=0
        for i in range(n):
            if X[i]<=a:
                s+=1
        print(s)

Solution (Python):



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)

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

Solution (Python):
while True:
    try:
        n = int(input())
        a = list(map(int,input().split()))
        s = sum(a)
        ave = s/n
    
        i = 0
        x = []
        while i <= n-1:
            if a[i] <= ave:
                x.append(a[i])
            i += 1

        print(len(x))
    
    except:
        if n == 0:
            break

Solution (Python):
while True:
    n=int(input())
    if n==0:
        break
    lst=list(map(int,input().split()))
    x=sum(lst)/n
    ans=0
    for i in lst:
        if x>=i:
            ans+=1
    print(ans)

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

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

Solution (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)

Solution (Python):

while True:
    kai = 0
    num = int(input())
    
    
    if num == 0:break

    
    line = list(map(int,input().split()))
    heikin = sum(line) / num
    
    
    for i in range(num):
        if line[i] <= heikin:kai += 1
    print(kai)

Solution (Python):
while True :
    n = int(input())
    
    if n == 0 :
        break
    
    else :
        A = list(map(int, input().split()))
        cnt = 0
        
        ave = sum(A) / n
        
        
        for i in range(len(A)) :
            if A[i] <= ave :
                cnt += 1
                
        print(cnt)

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

Solution (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)

Solution (Python):
import statistics

def get_data():
    data = int(input())
    return data

def get_data_list():
    data_list = input().split()
    for i, v in enumerate(data_list):
        data_list[i] = int(v)
    return data_list

def count_num_under_average(list_num, reverse_sorted_num_list, average_num):
    count = list_num
    for v in reverse_sorted_income_list:
        if v > average_num:
            count -= 1
        else:
            break
    return count


if __name__ == "__main__":
    while True:
        population = get_data()
        if population == 0:
            break
        income_list = get_data_list()
        reverse_sorted_income_list = sorted(income_list, reverse=True)
        average_income = statistics.mean(reverse_sorted_income_list)
        count = count_num_under_average(population, reverse_sorted_income_list, average_income)
        print(count)

Solution (Python):
def solve():
  while(True):
    N = int(input())
    if N == 0:
      break
    l = list(map(int,input().split()))
    ave = sum(l)//len(l)
    ans = 0
    for a in l:
      if a <= ave:
        ans+=1
    print(ans)
if __name__ == '__main__':
  solve()

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

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

Solution (Python):
while True:
    num = int(input())
    if num == 0:
        break
    else:
        x = input().split()
        for i in range(num):
            x[i] = int(x[i])
        ave = sum(x)/num
        count = 0
        for i in range(num):
            if x[i]<=ave:
                count += 1
        print(count)

Solution (Python):


import array
from fractions import Fraction
import functools
import itertools
import math
import os
import sys


def main():
    while True:
        N = read_int()
        if N == 0:
            break
        A = read_ints()
        print(solve(N, A))


def solve(N, A):
    avg = Fraction(sum(A), N)
    return len([a for a in A if a <= avg])





DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()

Solution (Python):
while True:
    num = int(input())
    if num == 0:
        break
    
    L = [int(x) for x in input().split()]
    
    ave = sum(L)/ len(L)
    
    c = 0
    for i in L:
        if i <= ave:
            c += 1
    print(c)

Solution (Python):
import os,re,sys,operator
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy
import heapq

setrecursionlimit(10**6)
while 1:
    n=int(stdin.readline().rstrip())
    if n==0:
        break
    a=[int(i) for i in stdin.readline().rstrip().split()]
    mean=sum(a)/n
    cnt=0
    for i in a:
        if i<=mean:
            cnt+=1
    print(cnt)

Solution (Python):






import sys
import math


class mymath:
    
    pi = 3.14159265358979323846264338

    
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    def pnum_check(self, n):
        if (n==1):
            return False
        elif (n==2):
            return True
        else:
            for x in range(2,n):
                if(n % x==0):
                    return False
            return True

    
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans
    
    
    def is_integer(self, n):
        try:
            float(n)
        except ValueError:
            return False
        else:
            return float(n).is_integer()

    
    def dist(self, A, B):
        d = 0
        for i in range(len(A)):
            d += (A[i]-B[i])**2            
        d = d**(1/2)
        return d

    
    def abs(self, n):
        if n >= 0:
            return n
        else:
            return -n

mymath = mymath()


class output:
    
    def list(self, l):
        l = list(l)
        
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()






















def printA(A):
    N = len(A)
    for i, n in enumerate(A):
        print(n, end='')
        if i != N-1:
            print(' ', end='')
    print()










def get_input():
    N = []
    while True:
        try:
            N.append(input())
            
            
        except EOFError:
            break
    return N

while True:
    N = int(input())
    if N==0:
        break
    A = [int(x) for x in input().split()]

    ave = sum(A)/N

    count = 0

    for i in A:
        if i <= ave:
            count += 1
    
    print(count)

Solution (Python):
while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    avg = sum(a)/n
    print(len([i for i in a if avg >= i]))

Solution (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)

Solution (Python):
def main(n):
	if n == 0:
		return False
	a = list(map(int,input().split()))
	m = sum(a)/n
	ans = 0
	for i in a:
		if i<= m:
			ans += 1
	print(ans)
	return True

while main(int(input())): pass

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

    AVE=sum(A)/n
    print(len([a for a in A if a<=AVE]))

Solution (Python):
while True:
    n = int(input())
    if n == 0:
        break
    A = list(map(int, input().split()))
    assert len(A) == n

    ave = sum(A) // n
    print(sum(1 for a in A if a <= ave))

Solution (Python):
ans_list = []

while True:
    n = int(input())
    if n == 0:
        break
    A = list(map(int,input().split()))
    ave = sum(A) / len(A)
    cnt = 0
    for a in A:
        if a <= ave:
            cnt += 1
    ans_list.append(cnt)

for ans in ans_list:
    print(ans)

Solution (Python):
x=[]
a=[] 
while True:
    try:
        a.append(list(map(int,input().split())))

    except:
        break;
        



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)

Solution (Python):



while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    m = sum(a)/n
    count = 0
    for i in a:
        if i <= m:
            count += 1
    print(count)

Solution (Python):
while 1:
    n = int(input())
    if n == 0: break
    a = sorted(list(map(int, input().split())))
    mean = sum(a) / len(a)
    count = 0
    for item in a:
        if item <= mean: count += 1
        else: break
    print(count)

Solution (Python):
while(True):
    n = input()
    if n=="0":
        break
    elif (int)(n)>50000:
        continue
    hairetu = input()

    tarou = hairetu.split(" ")
    avg=0

    for i in range(0,(int)(n)):
        avg=avg+(int)(tarou[i])
    avg=avg/(int)(n)

    cdnt=0
    for j in range(0,(int)(n)):
        if (int)(tarou[j]) <= (int)(avg):
            cdnt=cdnt+1 
    print(cdnt)

Solution (Python):
while True:
    n = int(input())
    if n == 0 :
        break
    lst = input().split()
    sum = 0

    for i in lst:
        sum = sum + int(i)

    mean = sum / len(lst)
    poor = 0

    for i in lst:
        if mean >= int(i):
            poor = poor +  1

    print(poor)

Solution (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)

Solution (Python):
ans_list = []
while True:
    n = int(input())
    if n==0:
        break
    A = list(map(int,input().split()))
    ave = sum(A) // len(A)
    cnt = 0
    for a in A:
        if a <= ave:
            cnt += 1
    ans_list.append(cnt)

for ans in ans_list:
    print(ans)

Solution (Python):
while True:
    n = int(input())
    if n <= 0: break
    a = [int(i) for i in input().split()]
    ave = sum(a)/n

    print(len(list(filter(lambda x: x <= ave, a))))

Solution (Python):
import bisect
def main(n):
    a = list(map(int, input().split()))
    a.sort()
    print(bisect.bisect_right(a,sum(a)/n))

while 1:
    n = int(input())
    if n == 0:
        break
    main(n)

Solution (Python):
while True:
    n = int(input())
    if n == 0:
        break
    datum = list(map(int, input().split()))
    ave = sum(datum) / n
    res = 0

    for data in datum:
        if data <= ave:
            res += 1

    print(res)

Solution (Python):
for v in range(10000):
  x = 0
  n = input()
  n = int(n)
  if n == 0:
    break
  else:
    a = input().split()
    b = [int(s) for s in a]
    for i in range(n):
      x += b[i]
      i += 1
    y = x/n
    z = 0
    for j in range(n):
      if y >= b[j]:
        z+=1
        j += 1
      else:
        j+=1
  print(z)

Solution (Python):


while True:
    n = int(input())
    if n == 0: break

    a = list(map(int, input().split()))
    ave_num = sum(a) / n

    cnt = 0
    for item in a:
        if item <= ave_num:
            cnt += 1

    print(cnt)

Solution (Python):
def main():
    while True:
        n = int(input())
        if not n:
            return
        aa = list(map(int,input().split()))
        ave = sum(aa)/n
        print(len([x for x in aa if x <= ave]))

if __name__ == '__main__':
    main()

Solution (Python):
import sys

def input(): return sys.stdin.readline().strip()
def LIST(): return list(map(int, input().split()))

def main():
    ans = []
    
    while 1:
        n = int(input())
        if n == 0:
            break
        else:
            a = LIST()
            heikin = sum(a) / n
            tmp = [x for x in a if x <= heikin]
            ans.append(len(tmp))
        
    for x in ans:
        print(x)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def LIST(): return list(map(int, input().split()))

ans = []
while 1:
	n = INT()
	if n == 0:
		break

	a = LIST()
	ave = sum(a)/n
	count = 0
	for i in a:
		if i <= ave:
			count += 1
	ans.append(count)
for i in ans:
	print(i)

Solution (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)

Solution (Python):
import sys


def solve(n):
    a = list(map(int, input().split()))
    ave = sum(a) / n
    count = 0
    for i in a:
        if i <= ave:
            count += 1

    print(count)


def main():
    while(True):
        n = int(input())
        if n == 0:
            sys.exit(0)
        else:
            solve(n)


main()

Solution (Python):
while(True):
    if(input()=="0"):
        exit()
    l = list(map(int,input().split()))
    print(len([i for i in l if i<=sum(l)/len(l)]))

Solution (Python):
while(True):
    n = int(input())
    if n==0:
        exit()
    l = list(map(int,input().split()))
    l.sort()
    s = sum(l)/n
    res = 0
    if l[-1]==l[0]:
        print(n)
        continue
    for i in range(n):
        if l[i]>s:
            print(i)
            break

Solution (Python):
while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    hei = sum(a)/len(a)
    count = 0
    for i in a:
        if hei >= i:
            count += 1
    else:
        print(count)

Solution (Python):
while True:
    n = int(input())
    if not n:
        break
    a = list(map(int, input().split()))
    ave = sum(a) / n
    print(len([x for x in a if x <= ave]))

Solution (Python):
while  True:
    N = int(input())
    if N == 0:
        break
    s = list(map(int,input().split()))
    avg = sum(s) / N
    ans = 0
    for c in s:
        if c <= avg:
            ans += 1
    print(ans)

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

Solution (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))))

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

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

  a =sum(A)
  bar = a/n

  count=0
  for i in A:
    if i<=bar:
      count+=1
  print(count)

Solution (Python):
while(True):
    N=int(input())
    if N==0:
        break
    a=[int(i) for i in input().split()]
    S=sum(a)
    ans=0
    for i in range(N):
        if a[i]*N<=S:
            ans+=1
    print(ans)

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

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

Solution (Python):
import bisect

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def solve():
    N=int(input())
    if N==0:
        exit()
    L=list(map(int,input().split()))
    ave = sum(L)//N
    L = sorted(L)
    low = bisect.bisect_right(L,ave)
    print(low)

while True:
    solve()

Solution (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)

Solution (Python):

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


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


def B():
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


def I_():
    return


def J():
    return


if __name__ == "__main__":
    A()

Solution (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)

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

Solution (Python):
def income_inequality():
    n = int(input())
    low_income_num = []
    while n:
        incomes = [int(i) for i in input().split()]
        sum = 0.0
        for i in incomes:
            sum += i
        everage = sum / len(incomes)
        count = 0
        for i in incomes:
            if i <= everage:
                count += 1
        low_income_num.append(count)
        n = int(input())
    for i in low_income_num:
        print(i)

income_inequality()

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

Solution (Python):

def main():
	while(1):

		a = int(input())
		if a == 0:
			break

		b = list(map(int, input().split()))
		mean = sum(b)/a
		count=0
		for i in range(a):
			if mean>= b[i]:
				count+=1
		print(count)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
while n != 0:
  list = input().split()

  for i in range(len(list)):
    list[i] = int(list[i])

  avgs = sum(list) / n
  i = 0
  a = 0
  for i in range(len(list)):
    if list[i] <= avgs:
      a = a + 1
  print(a)
  n = int(input())

Solution (Python):
while 1:
    n = int(input())
    if n == 0:
        break

    data = list(map(int, input().split()))
    mean = sum(data) / n

    cnt = 0
    for d in data:
        if d <= mean:
            cnt += 1

    print(cnt)

Solution (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())

Solution (Python):
while True:
    n = int(input())
    if n == 0:
        break
    li = [int(i) for i in input().split()]
    mean = sum(li) / len(li)
    cnt = 0
    for i in li:
        if float(i) <= mean:
            cnt += 1
    print(cnt)

Solution (Python):
ans = []
while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    avg = sum(a) / n
    ans.append(sum(avg >= x for x in a))
print(*ans, sep="\n")

Solution (Python):
res = []
while True :
    n = int(input())
    
    if n == 0 :
        break
    else :
        li = [int(x) for x in input().split()]
        avg = sum(li) / n
        res.append(sum([1 if x <= avg else 0 for x in li]))
        
for r in res :
    print(r)

Solution (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))

Solution (Python):
from statistics import *
while int(input()):
    a=list(map(int,input().split()))
    m=mean(a)
    c=0
    for i in a:
        if i<=m:c+=1
    print(c)

Solution (Python):
ans = []
while 1:
    N = int(input())
    if N == 0:
        break
    *A, = map(int, input().split())
    s = sum(A)
    cnt = 0
    for a in A:
        if a*N <= s:
            cnt += 1
    ans.append(cnt)
print(*ans, sep='\n')