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<cstdio>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int n,i,avg,sum,cnt,x[10000];
	while(1)	{
		scanf("%d",&n);
		if(n==0)	break;
		sum=0;
		for(i=0;i<n;i++)	{
			scanf("%d",&x[i]);
			sum+=x[i];
		}
		cnt=0;
		for(i=0;i<n;i++)	{
			if(x[i]*n<=sum)	cnt++;
		}
		printf("%d\n",cnt);
	}
	return 0;
}

C++: #include<iostream>
#include<list>
#include<vector>
#include<algorithm>
#include<string>
#include<stdio.h>
#include<math.h>
#include<unordered_map>
#include<map>

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using lst = list<int>;


bool solve()
{
	int n; cin >> n;

	if (n == 0)return false;

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

	int ans = 0;
	for (int i = 0; i < n; ++i)
	{
		ans += a[i] * n <= total;
	}

	cout << ans << endl;

	return true;
}


int main()
{
	while (solve());

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  while(1){
    int n;
    cin>>n;
    if(!n)
      break;
    unsigned int sum=0;
    int tmp[n];
    for(int i=0;i<n;i++){
      cin>>tmp[i];
      sum+=tmp[i];
    }
    int ava=sum/n;
    int cnt=0;
    for(int i=0;i<n;i++){
      if(tmp[i]<=ava)
        cnt++;
    }
    cout<<cnt<<endl;
  }
  return 0;
}

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

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

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];
        }
        for(i = 0; i < Members; 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, n) for (int i = 0; i < n; i++)
#define ALL(obj) obj.begin(), obj.end()

const int iINF = 1e9;
const long long llINF = 1e18;
const int MOD = 1e9 + 7;

using namespace std;

template <typename T>
int getFormer(const vector<T> &vec, T x) {
    return upper_bound(vec.begin(), vec.end(), x) - vec.begin() - 1;
}

template <typename T>
int getLatter(const vector<T> &vec, T x) {
    return lower_bound(vec.begin(), vec.end(), x) - vec.begin();
}

int solve(int N) {
    vector<double> a(N);
    REP(i, N) { cin >> a[i]; }
    double ave = accumulate(ALL(a), 0) / (double)N;
    int ans = 0;
    REP(i, N) {
        if (a[i] <= ave) {
            ans += 1;
        }
    }
    return ans;
}

int main() {
    int N;
    while (cin >> N && N) {
        cout << solve(N) << endl;
    }
}

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

using namespace std;

int main()
{
	int N,average=0,count=0;
	int a[10000];

	start:

	scanf("%d", &N);

	if (N == 0) {
		goto finish;
	}

	for (int i = 0; i < N; i++) {
		cin >> a[i];
		//scanf("%d", &a[i]);
	}

	for (int i = 0; i < N; i++) {
		average += a[i];
	}

	average /= N;

	for (int i = 0; i < N; i++) {
		if (a[i] <= average) {
			count++;
		}
	}

	cout << count<<endl;

	average = 0;
	count = 0;

	goto start;

	finish:

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << '\n';
typedef int64_t Int;
Int mod = 1e9+7;
Int INF = 1e9+7;

int main() {
    ios::sync_with_stdio(false);
    while (true) {
        double n;
        cin >> n;
        vector<double> a(n);
        if (n == 0) break;
        double x = 0.0;
        for (Int i = 0; i < n; i++) {
            cin >> a[i];
            x += a[i];
        }
        Int av = x / n;
        sort(a.begin(), a.end());
        Int res = 0;
        for (Int i = 0; i < (Int)n && a[i] <= av; i++) res++;
        dump(res);
    }
    return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, a[n], ans, mean;

    while (true) {
        ans  = 0;
        mean = 0;
        cin >> n;
        if (n == 0) {
            break;
        }
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            mean += a[i];
        }
        mean /= n;
        for (int i = 0; i < n; i++) {
            if (a[i] <= mean) {
                ans++;
            }
        }
        cout << ans << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
using ll = long long;
using P = pair<ll, ll>;
using namespace std;

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

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