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