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>
using namespace std;

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  while(1){
    int n;
    cin >> n;
    if(n==0) return 0;
    vector<int> a(n);
    LD total=0;
    for(int i=0;i<n;i++) cin >> a[i],total+=a[i];
    LD avg=total/n;
    int ans=0;
    for(int i=0;i<n;i++) if(a[i]<=avg) ans++;
    cout << ans << endl;
  }
  return 0;
}

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

using namespace std;

int main() {
	while (true) {
		int n;
		cin >> n;
		if (n == 0){break;}
		vector<int> vec;
		int ave = 0;
		for (int i = 0; i < n; i++) {
			int a;
			cin >> a;
			ave += a;
			vec.push_back(a);
		}
		int m = 0;
		ave = ave / n;
		for (int a : vec) {
			if (a <= ave) {
				m++;
			}
		}
		
		cout << m<<endl;
	}
	return 0;
	
}

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

int main(){
    while(true){
        unsigned n, a[50000], sum=0;
        cin >> n;
        if(n==0)
            break;

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

        sort(a,a+n);

        unsigned ave = sum/n;

        int i=0;
        while(ave>=a[i]&&i<n)
            i++;
        
        cout << i << 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;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
int a[10050];

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(true) {
        int n;
        cin >> n;
        if(n == 0) break;
        int sum = 0;
        for(int i = 1; i <= n; i++) {
            cin >> a[i];
            sum += a[i];
        }
        int ans = 0;
        for(int i = 1; i <= n; i++) {
            if(a[i] * n <= sum) ans++;
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
typedef long long ll;
int main(void){
    // Your code here!
    ll n;
    cin>>n;
    ll s[n];
    ll tot=0;
    for(int i=0;i<n;i++){
        cin>>s[i];
        tot+=s[i];
    }
    ll ans=0;
    for(int i=0;i<n;i++){
        if(tot/n>=s[i])ans++;
    }
    cout<<ans<<endl;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(;;){
        int n;
        cin>>n;
        if(!n){
            return 0;
        }
        vector<double> v(n);
        double a=0;
        rep(i,0,n){
            cin>>v[i];
            a+=v[i];
        }
        a/=n;
        int cnt=0;
        rep(i,0,n){
            if(v[i]<=a) cnt++;
        }
        cout <<cnt<<"\n";
    }
}

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

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define int long long
bool solve() {
    int N;
    cin >> N;
    if (N == 0) return false;
    vector<int> A(N);
    int sum = 0;
    REP(i, N) {
        cin >> A[i];
        sum += A[i];
    }
    int ans = 0;
    REP(i, N) {
        if (A[i] * N <= sum) ans++;
    }
    cout << ans << endl;
    return true;
}
signed main() {
    while (solve())
        ;
}

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

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