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>
#include<vector>

using namespace std;

int main(){
    int people,money,ave,count;
    vector<int> syotoku;
    vector<int> res;

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

        ave = 0;
        syotoku.clear();
        count = 0;
        for(int i=0;i<people;i++){
            cin>>money;
            ave+=money;
            syotoku.push_back(money);
        }

        ave/=people;
        for(int i=0;i<people;i++){
            if(syotoku[i]<=ave) count++;
        }

        res.push_back(count);
    }

    for(int i=0;i!=res.size();i++){
        cout<<res[i]<<endl;
    }
    return 0;
}

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

int main(){

    while(1){

        long long n; cin >> n;
        if(!n) break;
        vector<long long> a(n);
        long long sum = 0LL;
        for(int i = 0; i < n; i++){
            cin >> a[i];
            sum += a[i];
        }

        long long ans = 0LL;
        for(int i = 0; i < n; i++){

            if(sum >= a[i] * n) ans++;
        }

        cout << ans << endl;
    }

    return 0;
}

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


int main(){
    ios::sync_with_stdio(false);
	cin.tie(0);

    int n;
    while(cin>>n){
        if(n==0) break;
        int a[n];
        double 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(sum>=a[i]) ans++;
        }
        cout<<ans<<endl;


    }
    
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<utility>
#include<set>
using namespace std;
using ll = long long;

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

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

int main(void){
    int n;
    while(cin>>n,n){
        double s=0;
        int a[n];
        int ans=0;
        for(int i=0;i<n;i++) cin>>a[i],s+=a[i];
        s/=n;
        for(int i=0;i<n;i++){
            if(a[i]<=s) ans++;
        }
        cout<<ans<<endl;
    }
    return 0;
}

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

int main(){
    while(1){
    int n;
    cin >> n;
    if(n==0) break;
    vector<int> vec(n,0);
    for(int i=0;i<n;i++){
        cin >> vec.at(i);
    }
    int ave=0;
    for(int i=0;i<n;i++){
        ave +=vec.at(i);
    }
    ave=ave/n;
    int count=0;
    for(int i=0;i<n;i++){
        if(vec.at(i)<=ave) count++;
    }
    cout << count << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
const ll MOD = 1e9+7;

int main(){
  ll n;
  while(cin>>n,n){
  ll sum=0;
  ll a[11111];
  for(int i=0;i<n;i++){
	cin>>a[i];
	sum+=a[i];
  }
  ll cnt=0;
  for(int i=0;i<n;i++){
	if(a[i]<=sum/n)cnt++;
  }
  cout<<cnt<<endl;
  }
  return 0;
}

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

void solve(int n){
	int a[n] = {};
	int s = 0;
	for(int i=0; i<n; ++i){
		cin >> a[i];
		s += a[i];
	}
	int ans = 0;
	for(int i=0; i<n; ++i)
		if(a[i] * n <= s)
			++ans;
	cout << ans << "\n";
}

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	while(1){
		int n;
		cin >> n;
		if(n == 0) return 0;
		solve(n);
	}
}

C++: 
//---------------------------------------------------------------------------------------------------
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 <iostream>
#include <string>
using namespace std;


int main(){
        int a[10000];
        int i,avg,n,sum,count;

        while(1) {
                sum=0;
                count=0;

                cin>>n;

                if(n==0) {
                        break;
                }

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

                avg=sum/n;

                for(i=0; i<n; i++) {
                        if(avg>=a[i]) {
                                count++;
                        }
                }

                cout<<count<<endl;
        }
}

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

using i64 = int64_t;

int main(){
    int n;
    while(cin >> n, n != 0){
        vector<i64> v;
        i64 sum = 0;
        for(int i=0;i<n;++i){
            i64 tmp;
            cin >> tmp;
            v.push_back(tmp);
            sum += tmp;
        }
        double mean = sum / (double)n;
        int ans = 0;
        for(int i=0;i<n;++i){
            if(v[i] <= mean)ans++;
        }

        cout << ans << endl;
    }

    return 0;
}

C++: #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define INF 100000000
#define rep(i,s,n) for (int i = (int)(s); i < (int)(n); i++)
ll mod = 1000000007;
ll mod2 = 998244353;

int main(){
    vector<int> ans;
    while (true){
        int n;cin>>n;
        if (n==0) break;
        vector<int> a(n);
        ld sum = 0;
        rep(i,0,n){
            cin>>a[i];
            sum+=a[i];
        } 
        ld ave = sum/n;
        int num = 0;
        rep(i,0,n){
            if (a[i]<=ave) num+=1;
        }
        ans.push_back(num);
    }
    for(int an:ans){
        cout<<an<<endl;
    }
}