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:
    t=0
    n=int(input())
    if n==0:
        break
    else:
        y=list(map(int,input().split()))
        s=sum(y)/n
        for i in range(n):
            if y[i]<=s:
                t+=1
        print(t)

Python: while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))

    sum_a = sum(a)
    ans = 0
    for e in a:
        if e * n <= sum_a:
            ans += 1
    print(ans)

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 os,re,sys,operator
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy
import heapq

setrecursionlimit(10**6)
while 1:
    n=int(stdin.readline().rstrip())
    if n==0:
        break
    a=[int(i) for i in stdin.readline().rstrip().split()]
    mean=sum(a)/n
    cnt=0
    for i in a:
        if i<=mean:
            cnt+=1
    print(cnt)

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: while True:
    M=0
    
    A=int(input())
    
    if A==0:
        break
    
    L=list(map(int,input().split()))
    
    B=sum(L)/len(L)
    
    for i in range(A):
        if L[i]<=B:
            M+=1
            
    print(M)

Python: while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int,input().split()))
    ave = sum(a)/n
    ans = 0
    for i in range(n):
        if a[i] <= ave:
            ans += 1
    print(ans)

Python: anslist = []

while True:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    ans = 0
    ave = sum(a) / n
    for i in range(n):
        if a[i] <= ave:
            ans += 1

    anslist.append(ans)

for i in anslist:
    print(i)

Python: while True:
    n=int(input())
    if n == 0: break
    xs=list(map(int,input().split()))
    ave=sum(xs)/n
    print(sum(1 for x in xs if x <= ave))

Python: #!/usr/bin/python3

import array
from fractions import Fraction
import functools
import itertools
import math
import os
import sys


def main():
    while True:
        N = read_int()
        if N == 0:
            break
        A = read_ints()
        print(solve(N, A))


def solve(N, A):
    avg = Fraction(sum(A), N)
    return len([a for a in A if a <= avg])


###############################################################################
# AUXILIARY FUNCTIONS

DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()

Python: while(True):
    N=int(input())
    if N==0:
        break
    a=[int(i) for i in input().split()]
    S=sum(a)
    ans=0
    for i in range(N):
        if a[i]*N<=S:
            ans+=1
    print(ans)

Python: while True:
    n=int(input())
    if n==0:
        break
    a=list(map(int,input().split()))
    ans=0
    ave=sum(a)/n
    for i in range(n):
        if a[i]<=ave:
            ans+=1
    print(ans)

C++: //#include<bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#define pi 3.141592653897932384626
#define abs(x) ((x)>0?(x):(-(x)))
#define eps (double)(0.0000001)
#define fs first
#define se second
//freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
using namespace std;
long a[1000];
int main()
{
    long n;
    cin>>n;
    while(n){
        long s=0,x=0;
        for(long i=0;i<n;++i){scanf("%ld",&a[i]);s+=a[i];}
        s/=n;
        for(long i=0;i<n;++i){if(a[i]<=s)++x;}
        cout<<x<<endl;
        cin>>n;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    
    while(1){
        cin >> n;
        if(n == 0) return 0;
        int a[n];
        for (int i = 0; i < n; i++) cin >> a[i];
        int goukei = 0;
        for(int i = 0; i < n; i++) goukei = goukei + a[i];
        int heikin = goukei / n;
        int ans=0;
        for(int i = 0; i < n; i++){
            if(a[i] <= heikin) ans++;
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
  while(true){
    double a[100000], data, total=0;
    cin >> data;
    if(data == 0) break;
    for(int i=0; i<data; i++){
      cin >> a[i];
      total += a[i];
    }
    double ave = total/data;
    int n=0;
    for(int i=0; i<data; i++){
      if(a[i]<=ave) n++;
    }
    cout << n << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;

double n;

int main()
{
    while (cin >> n)
    {
        if (n == 0)
            return 0;
        vector<double> v;
        double sum = 0;
        for (int i = 0; i < n; i++)
        {
            double k;
            cin >> k;
            v.push_back(k);
            sum += k;
        }
        sum /= n;
        int ans = 0;
        for (int i = 0; i < n; i++)
        {
            if (v[i] <= sum)
                ans++;
        }
        cout << ans << endl;
    }
}