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 <iostream>
using namespace std;

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

C++: #include<iostream>
using namespace std;
int main(){
  int n;

  int array[100005];
  cin>>n;
  while(n!=0){
    int sum=0;
    int cnt=0;
    for(int i=0;i<n;i++){
      cin>>array[i];
      sum+=array[i];
    }
    
    for(int i=0;i<n;i++){
      if(array[i]*n<=sum){
	cnt++;
      }
    }
    cout<<cnt<<endl;
    cin>>n;
  }
  return(0);
}

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

int D[10005];

int main(){
    int n,avg,x,ans;
    while(1){
        avg=ans=0;
        cin>>n;
        if(!n) break;
        for(int i=0;i<n;i++){
            cin>>x;
            D[i]=x;
            avg+=x;
        }
        avg/=n;
        for(int i=0;i<n;i++) if(D[i]<=avg) ans++;
        cout<<ans<<endl;
    }
    return 0;
}

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

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    vector<int> a;
    while(cin >> n && n){
        a.resize(n);
        for(auto&& i : a){
            cin >> i;
        }
        sort(rbegin(a), rend(a));
        double avg = accumulate(begin(a), end(a), 0.0) / n;
        for(int i = 0; i < n; i++){
            if(avg >= a[i]){
                cout << n - i << "\n";
                break;
            }
        }
    }
}

C++: 
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
void init(){
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int n;
int sum=0;
int a[110000];

int main(){
  cin>>n;
  rep(i,n){
    cin>>a[i];
    sum+=a[i];
  }
  sum/=n;

  int asn=0;
  rep(i,n){
    if(sum<=a[i])
      asn++;
  }

  cout<<asn<<endl;
}

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

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

C++: #include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>
#define FOR(i,a,b) for (int i=(a),for_##i##_max=(b);i<=(for_##i##_max);++i)
#define RFOR(i,a,b) for (int i=(a),rfor_##i##_min=(b);i>=(rfor_##i##_min);--i)
#define REP(i,n) for (int i=0,rep_##i##_len=(n);i<(rep_##i##_len);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

namespace { // Basics

template<typename T>
void chmin(T &x, T y) {
  x = std::min(x, y);
}

template<typename T>
void chmax(T &x, T y) {
  x = std::max(x, y);
}

template<typename T>
const auto minimum = static_cast<T const &(*)(T const &, T const &)>(std::min);

template<typename T>
const auto maximum = static_cast<T const &(*)(T const &, T const &)>(std::max);

template<typename T>
T constexpr infty = std::numeric_limits<T>::max / 3;
template<>
auto constexpr infty<int> = 1'100'100'100;
template<>
auto constexpr infty<long long int> = 100'500'400'300'200'100LL;

using lli = long long int;
using ld = long double;

} // namespace

using namespace std;

int main() {
  // cout << fixed << setprecision(10);

  int N;
  while (cin >> N && N) {
    vector<lli> vals;
    REP(i, N) {
      lli A; cin >> A;
      vals.push_back(A);
    }
    lli sum = accumulate(begin(vals), end(vals), 0);
    int cnt = 0;
    REP(i, N) {
      if (N * vals[i] <= sum) {
        ++cnt;
      }
    }
    cout << cnt << endl;
  }
  return 0;
}

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

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