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

C++: #include <iostream>
using namespace std;
int main(void){
    int i,n,sum,cnt;
    int a[10000];
    
    while(1){
        cin >> n ;
        if(n == 0) break;
        
        sum = 0;
        
        for(i = 0;i < n;i++){
            cin >> a[i];
            sum += a[i];
        }
       // cout << sum;
        sum = sum / n;
        //cout << " " << sum << " ";
        cnt = 0;
        for(i = 0;i< n;i++){
            if(a[i] <= sum) cnt++;
        }
        
        cout << cnt << endl;
    }
}

C++: #include<bits/stdc++.h>
#define MAX 10001
#define inf 1<<29
#define linf (1e16)
#define eps (1e-8)
#define Eps (1e-12)
#define mod 1000000007
#define pi acos(-1.0)
#define phi (1.0+sqrt(5.0))/2.0
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define pd(a) printf("%.10f\n",(double)(a))
#define pld(a) printf("%.10Lf\n",(ld)(a))
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(a)-1;(b)<=i;i--)
#define Unique(v) v.erase(unique(all(v)),v.end())
#define equals(a,b) (fabs((a)-(b))<eps)
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<int,double> pid;
typedef pair<double,int> pdi;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<pii> vpi;

int main()
{
  int n;
  double a[MAX];
  while(cin>>n && n){
    double m=0;
    int ans=0;
    FOR(i,0,n){
      cin>>a[i];
      m+=a[i]/n;
    }
    FOR(i,0,n)
      if(m-a[i]>-eps)ans++;
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

int N, A[10101];
//---------------------------------------------------------------------------------------------------
void _main() {
	while (cin >> N) {
		if (N == 0) return;
		rep(i, 0, N) cin >> A[i];

		int sm = 0;
		rep(i, 0, N) sm += A[i];

		int ans = 0;
		rep(i, 0, N) if (A[i] * N <= sm) ans++;
		printf("%d\n", ans);
	}
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	while (cin >> n, n)
	{
		vector<int> a(n);
		long long sum = 0;
		for (int i = 0; i < n; ++i)
		{
			cin >> a[i];
			sum += a[i];
		}
		sum /= n;
		int ans = 0;
		for (int i = 0; i < n; ++i)
		{
			if (a[i] <= sum)
				ans++;
		}
		cout << ans << endl;
	}
}

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

int main(){
  int n;
  double ave = 0;
  double sum = 0;
  int ans = 0;

  while(1){
    cin >> n;
    if(n==0){
      break;
    }

    int a[n];

    for(int i=0;i<n;i++){
      cin >> a[i];
      sum +=a[i];
    }
    ave = sum/n;

    for(int i=0;i<n;i++){
      if(ave>=a[i]){
        ans++;
      }
    }

    cout << ans << endl;
    sum = 0;
    ans = 0;
  }

  return 0;
}

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

int main(){
  int n;
  int a[n];
  while(1){
  cin >> n;
  for(int i = 0; i< n; i++){
    cin >> a[i];
  }
  if(n == 0) break;
  
  int sum = 0;
  for(int i = 0; i < n; i++){
    sum += a[i];
   }
  double ave = 1.0 * sum / n;
  int count = 0;
  for(int i =0; i < n; i++){
   if(a[i] <= ave) count += 1;
  }

  cout << count << endl;
  }
return 0;
}

C++: #include <iostream>

int main(void)
{
    using namespace std;
    int Members, Scores[10000], Total = 0, Average, Poors = 0, i;

    while(true)
    {
        cin >> Members;
        for(i = 0; i < Members; i++)
        {
            Scores[i] = 0;
            cin >> Scores[i];
            Total = Total + Scores[i];
        }
        Average = Total / Members;
        for(i = 0; i < Members; i++)
        {
            if(Scores[i] <= Average)
            {
                Poors++;
            }
        }
        cout << Poors << "\n";
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >>n;
    int a[10005];
    for(int i =0;i<n;i++)
    {
        cin >> a[i];
    }
    while(n>=2 &&n<=10000)
    {
       int sum=0,ave;
       for(int i = 0;i<n;i++)
        sum +=a[i];
       ave = sum/n;
       int count=0;
       for(int i =0;i<n;i++)
       {
           if(a[i]<=ave)
            count++;
       }
       cout <<count<<endl;




    cin >>n;
    for(int i =0;i<n;i++)
    {
        cin >> a[i];
    }
    }



    return 0;
}