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 = list(map(int, input().split()))
    avg = sum(a)/n
    print(len([i for i in a if avg >= i]))

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

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)

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)

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)

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)

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

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)

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)

Python: #無限ループと標準入力とカウンタ変数のリセット
while True:
    kai = 0
    num = int(input())
    
    #入力値が0だったら終わる
    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)

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)

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

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

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

Python: # AOJ 1624 Income Inequality
# Python 2018.7.12 bal4u

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

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)

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

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: 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 = list(map(int, input().split()))
    hei = sum(a)/len(a)
    count = 0
    for i in a:
        if hei >= i:
            count += 1
    else:
        print(count)

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)

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: 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: #!/usr/bin/env python3

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)

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)

Python: import bisect
# python template for atcoder1
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()

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)

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)