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 "bits/stdc++.h"

#define REP(i, n ,N) for(ll i = (n); i < (N); i++)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;
ll inf = 1e18;

ll n, m;
ll a[10101];

int main(){
	while(cin >> n && n > 0){
		ll ans = 0;
		ll sum = 0;
		REP(i,0,n){
			cin >> a[i];
			sum += a[i];
		}
		REP(i,0,n){
			if(a[i] * n <= sum){
				ans++;
			}
		}
		p(ans);
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
  int n;
  int a[10004];

  while ( cin >> n ) {
    // n == 0 と同じ
    if (!n) { break; }

    double ave_num = 0;

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

    ave_num /= n;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] <= ave_num) {
        cnt++;
      }
    }
    cout << cnt << endl;
  }

  return 0;
}

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

typedef long long ll;

int main(){
	int n;
	while(cin >> n,n){
		vector<int> a(n);
		int sum=0;
		for(int i=0;i<n;i++){
			cin >> a[i];
			sum+=a[i];
		}
		int res=0;
		for(int i=0;i<n;i++){
			if(sum>=n*a[i])res++;
		}
		printf("%d\n",res);
	}
}

C++: #include<iostream>
#include<algorithm>

using namespace std;
typedef long long ll;

int n;
ll ar[10000];

int main() {
	
	while (1) {
		cin >> n;
		if (n == 0)break;
		ll avep = 0;
		for (int i = 0; i < n; i++) {
			cin >> ar[i];
			avep += ar[i];
			ar[i] *= n;
		}

		sort(ar, ar + n);
		cout << upper_bound(ar, ar + n, avep) - ar << endl;


	}

	return 0;
}

C++: #include <iostream>
#include <vector> 
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <cerrno>
#include <cfenv>
#include <math.h>
#include <iomanip>
#include <limits>
#define ll long long int

using namespace std;

int main(){

    int n;

    while(true){

        cin >> n;

        if(n==0){
            break;
        }

        vector<int> data(10000);
        int sum = 0;

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

        double ave = (sum/n);

        int cnt = 0;
        
        for(int i=0;i<n;i++){
            if(ave>=(double)data[i]){
                cnt++;
            }
        }

        cout << cnt << endl;

    }

    return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
    int n,i,a[50005];
    while(1)
    {
        cin>>n;
        if(n<2) break;
        int average=0,total=0;
        for(i=0;i<n;i++)
            {
                cin>>a[i];
                total=total+a[i];
            }
         average=total/n;
         int numbers=0;
         for(i=0;i<n;i++)
         {
             if(a[i]<=average)
             numbers++;
         }
         cout<<numbers<<endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<int ,P> P3;
typedef pair<P ,P> PP;
const ll MOD = ll(1e9+7);
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(1e5 + 5);
const double EPS = 1e-6;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

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

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

int main(){
        double n;
        while (cin >> n && n != 0){
                int ans = 0;
                double wa = 0;
                vector<double> a(n);
                for (int i = 0; i < n; i++){
                        cin >> a[i];
                        wa += a[i];
                }
                double avg = wa / n;
                for (int i = 0; i < n; i++){
                        if (avg >= a[i]) ans++;
                }
                cout << ans << endl;
        }
        return 0;
}

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

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

    while(true)
    {
        cin >> Members;
        if(!Members){ break; }
        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>
#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);
	}