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;
using ll = long long;
using ld = long double;
#define REP(i,i_len) for (ll i = 0, i##_len = (i_len); i < i##_len; i++)

int main() {

    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll n;
    while (cin >> n, n) {

        vector<ll> a(n);
        REP(i, n) cin >> a[i];
        
        ll sum = 0, ans = 0;
        REP(i, n) sum += a[i];
        REP(i, n) {
            if (sum >= a[i] * n) {
                ans++;
            }
        }
        cout << ans << endl;

    }

}

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

using namespace std;

bool solve() {
    int N;
    cin >> N;
    if (N == 0) return false;

    vector<int> A(N);
    for (auto& a : A) cin >> a;

    int sum = accumulate(A.begin(), A.end(), 0);
    int ans = 0;
    for (auto a : A) {
        if (a * N <= sum) ++ans;
    }
    cout << ans << endl;
    return true;
}

int main() {
    while (solve()) {}
    return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
    int n;
    while(true){
        cin>>n;
        if(n==0){
            break;
        }
        int a[500010],sum=0,cnt=0;
        for(int i=0;i<n;++i){
            cin>>a[i];
            sum+=a[i];
        }
        for(int i=0;i<n;++i){
            if(n*a[i]<=sum){
                cnt++;
            }
        }
        cout<<cnt<<endl;
    }

    return 0;
}

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

int main(){
    int n;
    cin >> n;
    while(n > 0){
        vector<int> a(n);
        for(int i=0; i<n; i++) cin >> a[i];
        long long sm = accumulate(a.begin(), a.end(), 0LL);
        int ans = 0;
        for(int i=0; i<n; i++)if(sm/n >= a[i]) ans++;
        cout << ans << endl;
        cin >> n;
    }
}

C++:  #include <bits/stdc++.h>
 using namespace std;
 
 double a[500000];
 
 int main() {
          int n;
          double mean;
           int ans;
          while(true) {
                  cin >> n;
                  if (n == 0) break;
 
                  for(int i = 0;i < n;i++) cin >> a[i];
 
                  mean = 0;
                  ans = 0;
 
                  for(int i = 0;i < n;i++) mean += a[i];
 
                  mean /= n;
 
                  for(int i = 0;i < n;i++) {
                          if (a[i] <= mean) ans += 1;
                  }
 
                  cout << ans<< "\n";
          }
  }

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 min = 0;
		rep(i, 0, N) min += A[i];

		int answer = 0;
		rep(i, 0, N) if (A[i] * N <= min) answer++;
		printf("%d\n", answer);
	}
}

C++: //https://onlinejudge.u-aizu.ac.jp/challenges/sources/ICPC/Prelim/1624?year=2018

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;

    while (cin >> n, n) {
        vector<int> a(n);
        int sum = 0;
        for (int i = 0; i < n; ++i) {
            int t;
            cin >> t;
            sum += t;
            a[i] = t * n;
        }
        sort(a.begin(), a.end());

        cout << upper_bound(a.begin(), a.end(), sum) - a.begin() << endl;
    }

    return 0;
}

/*
 * 除算による誤差が怖いので，a[i]<=S/nのかわりに
 * n*a[i]<=Sを調べた。
 * 
 */

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

using namespace std;

int main() {
  int n;

  cin >> n;
  while(n != 0) {
    vector<int> data;
    for(int i = 0; i < n; i++) {
      int x;
      cin >> x;
      data.push_back(x);
    }


    int sum = 0;
    for(int i = 0; i < data.size(); i++) {
      sum += data.at(i);
    }
    double ave = sum / data.size();

    int cnt = 0;
    for(int i = 0; i < data.size(); i++) {
      if(ave >= data.at(i)) {
        cnt++;
      }
    }

    cout << cnt << endl;
    cin >> n;
  }
}