Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo()
	defer io.Flush()
	for {
		n := io.NextInt()
		if n == 0 {
			break
		}
		a := make([]int, n)
		sum := 0
		for i := 0; i < n; i++ {
			a[i] = io.NextInt()
			sum += a[i]
		}
		cnt := 0
		for i := 0; i < n; i++ {
			if a[i] <= sum/n {
				cnt++
			}
		}
		io.Println(cnt)
	}
}

// I/O template
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buff []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buff = append(buff, line...)
		if !isPrefix {
			break
		}
	}
	return string(buff)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	s := io.tokens[io.nextToken]
	io.nextToken++
	return s
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntSlice(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func (io *Io) PrintStringSlice(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func ExampleIo() {
	io := NewIo()
	defer io.Flush()
	a := make([]int, 0, 3)
	a[0], a[1], a[2] = io.NextInt(), io.NextInt(), io.NextInt()
	io.Println(a)
	io.PrintIntSlice(a)
	Log("io", a)
}

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

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)