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 <stdio.h>
typedef long long ll;

int main(void) {
  ll i, n;
  while( 1 ) {
    scanf("%lld", &n);
    if(!n) break;
    ll a[n], ans = 0, now = 0;
    for(i = 0; i < n; ++i) scanf("%lld", &a[i]), now += a[i];
    for(i = 0; i < n; ++i) if(now >= a[i] * n) ++ans;
    printf("%lld\n", ans);
  }
  return 0;
}

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

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

    while(true)
    {
        cin >> Members;
        if(!Members){ break; }
        for(i = 0; i < Members; i++)
        {
            cin >> Scores[i];
            Total += Scores[i];
        }
        for(i = 0; i < Members; i++)
        {
            if(Scores[i] * Members <= Total){ Poors++; }
        }
        cout << Poors << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define all(a) (a).begin(),(a).end()

int main(void){
    int n;
    while(cin>>n, n){
        vector<int> a(n);
        rep(i,n){
            cin>>a[i];
        }
        int ave = accumulate(all(a), 0)/n;
        int cnt = 0;
        rep(i,n){
            if(a[i] <= ave) cnt++;
        }
        cout<<cnt<<endl;
    }  
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define INF 1000000000
#define mod 1000000007
using ll=long long;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    
    while(true){
        ll n;cin>>n;
        if(n==0) return 0;
        vector<ll> a(n);
        ll sum=0;
        rep(i,n){
            cin>>a[i];
            sum+=a[i];
        }
        ll ave=sum/n;
        ll cnt=0;
        rep(i,n){
            if(a[i]<=ave) cnt++;
        }
        cout<<cnt<<endl;
    }
    return 0;
}

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

int main() {

  while (1) {

    int n;

    cin >> n;
    if (n == 0) break;

    vector<int> income(n, 0);
    
    int tmp = 0;
    int sum = 0;
    double ave;

    for (int i = 0; i < n; i++) {
      cin >> tmp;
      sum += tmp;
      income[i] = tmp;
    }
    ave = sum / n;

    sort(income.begin(), income.end());
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (income[i] > ave)
        break;
      else
        ans += 1;
    }
    cout << ans << endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  while (1){
    int n;
    cin >> n;
    if (n == 0){
      break;
    }
    vector<int> a(n);
    for (int i = 0; i < n; i++){
      cin >> a[i];
    }
    long long sum = 0;
    for (int i = 0; i < n; i++){
      sum += a[i];
    }
    int ans = 0;
    for (int i = 0; i < n; i++){
      if ((long long) a[i] * n <= sum){
        ans++;
      }
    }
    cout << ans << endl;
  }
}

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

using namespace std;
int b[100005];
int main()
{
	int n,i,s,a[100005];
	do
	{
		cin >> n;
		if(n!=0)
		{
		s=0;
		for(i=0; i<n; i++)
		{
			cin >> a[i];
			b[a[i]]++;
			s+=a[i];
		}
		s=s/n;
		for(i=1; i<=100000; i++)
			b[i]+=b[i-1];
		cout << b[s] << endl;
		for(i=0; i<=100000; i++)
			b[i]=0;
		}
	}while(n!=0);
}

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

#define int ll
#define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i)
#define all(a) (a).begin(),(a).end()
#define SUM(a) accumulate(all(a),int(0))
using ll  = long long;
using vi  = vector<int>;

signed main(){
  int n;
  while(cin >> n, n){
    vi a(n);
    rep(i,n) cin >> a[i];

    int s = SUM(a);
    int ans = 0;
    rep(i,n){
      if(a[i]*n <= s) ans++;
    }
    cout << ans << endl;
  }
}

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

int main() {
    int n, a[100000];
    double ave = 0.0;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        ave += a[i];
    }
    ave /= n;
    int under = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] <= ave) {
            ++under;
        }
    }
    cout << under << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
class Edge{
public:
    int from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};



int main(){
   int n;
   while(cin >> n){
       if(n == 0)return 0;
       vector<float> v;
       for(int i = 0;i < n;i++){
           float b;cin >> b;
           v.push_back(b);
       }
       float sum = accumulate(v.begin(), v.end(), 0.0) / n;
       int ans = 0;
       for(auto f : v){
           if(sum >= f)ans++;
       }
       cout<<ans<<endl;
   }
}

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

int main() {
	int N;
	while (cin >> N) {
		if (N == 0) return 0;
		vector<int> A(N);
		int SUM = 0;
		for (int i = 0; i < N; i++) {
			cin >> A[i];
			SUM += A[i];
		}
		int ANS = 0;
		for (int i = 0; i < N; i++) {
			if (A[i] * N <= SUM) ANS++;
		}
		cout << ANS << endl;
	}
}