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: 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)

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)

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

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)

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

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

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)

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)]))

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)

Python: # import sys
# input = sys.stdin.readline

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)

Python: # coding=utf-8

###
### for python program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    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

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

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

    ### Mat Multiplication
    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
    
    ### intチェック
    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()

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

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
# print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
# print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
# print(" {}".format(i), end="")

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

# リスト内包表記 ifあり
# [x-k if x != 0 else x for x in C]

# ソート
# N = N.sort()

# 10000個の素数リスト
# P = mymath.pnum_eratosthenes(105000)

def get_input():
    N = []
    while True:
        try:
            N.append(input())
            #N.append(int(input()))
            #N.append(float(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)

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

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)

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]))

Python: n=int(input())
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)