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 int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

typedef pair<int, int> P;

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( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e9;
const int MOD = 1e9 + 7;

signed main(){
    int N;
    while( cin >> N, N ){
        vector<int> a( N );
        int sum = 0;
        REP( i, N ) {
            cin >> a[i];
            sum += a[i];
        }

        double ave = sum / N;
        int ans = 0;
        REP( i, N ){
            if( a[i] <= ave ) ans++;
        }

        cout << ans << endl;
    }
}

C++: #include <iostream>
#include <cstring>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <queue>
#include <functional>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#define ll long long
#define REP(i,n) for(int i=0;i<(n);i++)
#define PB push_back
#define MP make_pair
using namespace std;
int main(){
    for(;;){
        int n;
        cin>>n;
        if(n==0)
            break;
        int a[n];
        int tot=0;
        for(int i=0;i<n;i++){
            cin>>a[i];
            tot+=a[i];
        }
        tot/=n;
        int res=0;
        for(int i=0;i<n;i++){
            if(a[i]<=tot)
                res++;
        }
        cout<<res<<endl;
    }
}

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

int n,a[10005];

int main()
{
    while (scanf("%d",&n)==1)
    {
        if (n==0) break;
        int sum=0;
        for (int i=1;i<=n;i++)
        {
            scanf("%d",&a[i]);
            sum+=a[i];
        }
        int ans=0;
        for (int i=1;i<=n;i++)
        {
            if (a[i]*n<=sum) ans++;
        }
        printf("%d\n",ans);
    }
}

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

#define MAX 10000
int main(){
	int a[MAX];
	int n;
	while(1){
		cin>>n;
		if(n==0)break;
		int sum=0, ans=0;

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

		cout<<ans<<endl;
	}

	return 0;
}

C++: #include<bits/stdc++.h>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define PII pair<int,int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define PDD pair<double, double>
#define MOD ((int)1e9 + 7)
#define INF ((int)2e9)
#define INFLL ((LL)2e18)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
#define BIT(x) (2 << (x))
using namespace std;

LL modinv(LL a){
    LL b = MOD, u = 1, v = 0;
    while(b){
        LL t = a / b;
        a -= t * b;swap(a, b);
        u -= t * v;swap(u, v);
    }
    u%=MOD;
    if(u < 1) u += MOD;
    return u;

}

LL exp(LL a, LL b){
    LL res = 1;
    LL sum = a;
    while(b){
        if(b&1)res = (res * sum);
        sum = (sum * sum);
        b>>=1;
    }
    return res;
}

double exp(double a, LL b){
    double res = 1;
    double sum = a;
    while(b){
        if(b&1)res = (res * sum);
        sum = (sum * sum);
        b>>=1;
    }
    return res;
}

signed  main(){
    int N;
    while(cin>>N&&N){
        LL sum = 0;
        vector<LL> line(N);
        for(auto &i:line){
            cin >> i;
            sum += i;
        }
        LL avg=sum/N;
        int ans = 0;
        for(auto i:line){
            ans += i <= avg;
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
 
int main(){
  int n,ans;
  double ave,sum;
 
  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(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 <iostream>
#include <algorithm>
#include <vector>
#include <list>

#define LL long long

using namespace std;

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

C++: #include<iostream>
using namespace std;
int main(void){
    for(;;){
        int n;
        cin >> n;
        if(n==0){return 0;}
        int a[n];
        for(int i=0;i<n;i++){
            cin >> a[i];
        }
        long long int sum=0;
        for(int i=0;i<n;i++){
            sum += a[i];
        }
        int ave = sum/n;
        int cnt = 0;
        for(int i=0;i<n;i++){
            if(a[i]<=ave){cnt++;}
        }
        cout << cnt << endl;
    }
}