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;

int main() {
  int n;
  while (cin >> n, n) {
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    ll sum = accumulate(begin(a), end(a), 0LL);

    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (1LL * a[i] * n <= sum) ans++;
    }

    cout << ans << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};

int income[10020];


int main(){
	int n;
	while(1){
		cin >> n;
		if(n == 0) break;
		int sum = 0;
		for(int i = 0;i < n;i++){
			cin >> income[i];
			sum += income[i];
		}
		int av = sum / n;
		int ans = 0;
		for(int i = 0;i < n;i++){
			if(income[i] <= av) ans++;
		}
		cout << ans << endl;

	}
}

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

int main(){
  while(true){
    int n, a[100100] = {}, sum = 0, count = 0, N;
    cin>>N;
    if(!N) break;
    for(int i = 1; i <= N; i++){
      cin>>a[i];
      sum += a[i];
    }
    for(int i = 1; i <= N; i++){
      if(a[i]*N <= sum)count++;
    }
    cout<<count<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string.h>
#include<string>
#include<vector>
#include <queue>
#include<cstdio>
#include<algorithm>
#define ls (o << 1)
#define rs (o << 1 | 1)
#define mid ((L + R) >> 1)
using namespace std;
int n;
int main(){
    while(scanf("%d",&n) == 1 && n){
        long long sum = 0;
        vector<long long> a(n);
        for(int i = 0;i < n; ++i){
            scanf("%lld", &a[i]);
            sum += a[i];
        }
        int cnt = 0;
        for(int i = 0;i < n; ++i){
            if(a[i] * n <= sum){
                cnt ++;
            }
        }
        printf("%d\n", cnt);
    }
    
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  while (true) {
    int n; cin >> n;
    if (!n) break;
    V<lint> a(n); for (auto&& e : a) cin >> e;
    lint s = accumulate(begin(a), end(a), 0LL);
    int res = 0;
    for (int i = 0; i < n; ++i) {
      res += n * a[i] <= s;
    }
    cout << res << '\n';
  }
}

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

using namespace std;
using ll = long long;

void suzuken() {
	ll n; scanf("%lld", &n); if (n == 0) exit(0);
	vector<ll> a(n); for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
	sort(a.begin(), a.end());
	ll sum = 0;
	for (int i = 0; i < n; i++) sum += a[i];
	ll res = upper_bound(a.begin(), a.end(), sum / n) - a.begin();
	cout << res << "\n";

}
int main() {
	int kkt = 89;
	while (kkt) {
		suzuken();
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<bool> vb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 29);
const ll LINF = 1e18;
const double PI = acos(-1);

template<typename T>vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...)); }
template<typename T, typename U, typename... V>
typename enable_if<is_same<T, U>::value != 0>::type
fill_v(U & u, const V... v) { u = U(v...); }
template<typename T, typename U, typename... V>
typename enable_if<is_same<T, U>::value == 0>::type
fill_v(U & u, const V... v) { for (auto& e : u) fill_v<T>(e, v...); }
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; }

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	while (N != 0) {
		vi A(N);
		int sum = 0;
		REP(i, N) {
			cin >> A[i];
			sum += A[i];
		}
		double ave = (double)sum / (double)N;
		int ans = 0;
		REP(i, N) {
			if (ave >= A[i]) {
				ans++;
			}
		}
		cout << ans << endl;
		cin >> N;
	}
	return 0;
}

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

int main(){
  while(1){
    int n;
    cin >> n;

    if(n==0){
      break;
    }

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

    int mean=total/n;
    int person=0;
    for(int i=0; i<n; i++){
      if(a[i]<=mean){
        person++;
      }
    }

    cout << person << endl;
  }
}