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

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)