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