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

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

Python: while True:
  #1行目nを読み込む
  cnt = 0
  n =int(input())
  #もしn==0ならbreak
  if n==0:
    break
  #n>0ならば
  if n>0:
    #配列a[i]を読み込む(1<=i<=n)
    a = list(map(int, input().split()))
 
  ans = sum(a) //n
  for i in range(n):
    if a[i] <= ans:
      cnt+=1
  print(cnt)

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)

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

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

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

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

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)

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

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)

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)

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)

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)

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

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]))
    #リスト内包表記、条件を満たす要素の数をlen()で表示

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)

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)

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)

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)

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)

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

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)

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)

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

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)

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)