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;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    int n;
    while(cin >> n){
        if(n == 0) break;
        vector<double> a(n); for(auto& in:a) cin >> in;
        double ave = accumulate(a.begin(),a.end(),0.0)/n;
        sort(a.begin(),a.end());
        cout << (int)(upper_bound(a.begin(),a.end(),ave)-a.begin()) << endl;
    }
    
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    solve<ll>();
    //cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}

C++: #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) {
            cin >> a[i];
            sum += a[i];
        }
        int ans = 0;
        for(int i = 0; i < n; ++i) {
            ans += a[i] * n <= sum;
        }
        cout << ans << endl;
    }
}

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

int main() {
	int n;
	while (cin >> n, n) {
		vector<double> a(n);
		double sum = 0;
		for (double& i : a) {
			cin >> i;
			sum += i;
		}
		int ans = 0;
		for (double& i : a) {
			if (i <= sum / n) ++ans;
		}
		cout << ans << endl;
	}
}

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


int main()
{
	double a[10000];
	while(1)
	{
		int n;
		double ave=0.0f;
		cin>>n;
		if(n==0)
			break;

		for(int i=0;i<n;i++)
		{
			cin>>a[i];
			ave+=a[i];
		}
		sort(a,a+n);
		ave/=(double)n;
		int ans=0;
		for(int i=0;i<n;i++)
		{
			if(a[i]>ave)
				break;
			ans++;
		}
		cout<<ans<<endl;
	}
	return 0;
}

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




int main(){
	while(true){
	double a[100005] = {0}, ave = 0, sum = 0;
	int ans = 0, n = 0;
	cin >> n;
	if(n == 0) return 0;
	ans = 0;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		sum += a[i];
	}
	sum /= n;
	//cout<<sum<<endl;
	for(int i = 0; i < n; i++){
		if(a[i] <= sum) ans++;
	}
	printf("%d\n", ans);
}
	return 0;
}

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

int main(){
  while(1){
    int n;
    cin >> n;
    if(n == 0){
      break;
    }
    vector<int> a(n);
    long long 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(sum >= a[i]*n){
        ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

int main() {
	while (true) {
	int n;
	std::cin >> n;
	if (n == 0) break;
	std::vector<int> a(n);
	int sum = 0;
	for(auto& v : a) {
		std::cin>>v;
		sum += v;
	}

	int ans = 0;
	for(auto v : a) {
		if (v * n <= sum) ++ans;
	}

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

}

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(){
  while(true){
    sum=0;
    cin>>n;
    if(n==0) break;
    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 <cstdio>

int a[(int)1e4 + 10];

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