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 <algorithm>
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;

int main() {
    int n;
    while (cin >> n, n) {
        vector<int> a(n);
        for (int &ai: a) cin >> ai;
        int sum = accumulate(a.begin(), a.end(), 0);
        double ave = 1.0 * sum / n;
        int cnt = 0;
        for (int i = 0; i < n; i++) if (a[i] <= ave) cnt++;
        cout << cnt << endl;
    }
    return 0;
}

C++: #pragma region _head

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<stack>
#include<numeric>
#include<utility>

#pragma region _define

#define int LL
#define f(i,a,b) for(LL i=a;i<b;i++)
#define rep(i,n) for(LL i=0;i<n;i++)
#define f_vI(v,n) f(i,0,n)cin>>v[i]
#define f_v2I(v1,v2,n) f(i,0,n)cin>>v1[i]>>v2[i]
#define f_v3I(v1,v2,v3,n) f(i,0,n)cin>>v1[i]>>v2[i]>>v3[i]
#define f_vO(v,n,option) f(i,0,n)cout<<v[i]<<option;
#define all(a) a.begin(),a.end()
#define size(s) ((int)s.size())
#define check() cout<<"! ! !"
#define endl "\n"
#define _y() cout<<"Yes"<<endl
#define _Y() cout<<"YES"<<endl
#define _n() cout<<"No"<<endl
#define _N() cout<<"NO"<<endl
#define INT_INF 1<<29
#define LL_INF 1LL<<60
#define MOD 10000007

#pragma endregion

#pragma region _using

using namespace std;

using LL = long long;
using st = string;
using vi = vector<LL>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vc = vector<char>;
using vs = vector<st>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using qi = queue<int>;
using qc = queue<char>;
using qs = queue<st>;
using si = stack<LL>;
using sc = stack<char>;
using ss = stack<st>;
using pi = pair<LL, LL>;
using mll = map<LL, LL>;
using vpi = vector<pi>;

#pragma endregion


//素数判定
bool is_prime(int n) {
	for (int i = 2; i*i <= n; i++) {
		if (n%i == 0) {
			return false;
		}
	}
	return true;
}

void y_n(bool p) {
	if (p)_y();
	else _n();
}

void Y_N(bool p) {
	if (p) _Y();
	else _N();
}

LL gcd(LL a, LL b) {
	LL r;
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}
LL lcm(LL a, LL b) {
	return (a / gcd(a, b)*b);
}

//階乗計算
LL factorial(LL n) {
	LL a = 1, ret = 1;
	while (a < n) {
		a++;
		ret *= a;
		//ret %= 1000000007;
	}
	return ret;
}


/************************************************************************/
signed main(void) {
	cin.tie(0); ios::sync_with_stdio(false);

	while (1) {
		int n;
		cin >> n;
		if (n == 0)break;
		vi a(n);
		rep(i, n)cin >> a[i];
		double sum = 0;
		rep(i, n) {
			sum += a[i];
		}
		sum = sum / (double)n;
		int cnt = 0;
		rep(i, n) {
			if (a[i] <= sum) {
				cnt++;
			}
		}
		cout << cnt << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n,data[10000];
  while(cin>>n&&n){
    int cnt=0,sum=0;
    for(int i=0;i<n;++i){
      cin>>data[i];
      sum+=data[i];
    }
    int ave=sum/n;
    for(int i=0;i<n;++i){
      if(data[i]<=ave) ++cnt;
    }
    cout<<cnt<<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 main(){
    int n;
    while(cin>>n, n){
        double ave=0;
        vector<double> a(n);
        for(int i=0; i<n; i++){
            cin>>a[i];
            ave+=a[i];
        }
        ave/=n;

        int ans=0;
        for(int i=0; i<n; i++){
            if(a[i]<=ave) ans++;
        }
        cout << ans << endl;
    }
}

C++: #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
const long double PI = acos(-1.0L);
const long long MOD = 1000000007LL;
// const long long MOD = 998244353LL;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
template<class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true;} return false; }
template<class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true;} return false; }
//////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    while (1) {
        ll N; cin >> N;
        if (N==0) break;
        vector<ll> A(N);
        rep(i,N) cin >> A[i];

        ll ave = accumulate(all(A),0LL) / N;
        int ans = 0;
        rep(i,N) {
            if (A[i] <= ave) ans++;
        }

        cout << ans << endl;
    }
}

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

	while (cin >> n)
	{	
		if (n == 0) break;
		vector<int> A(n);
		int su = 0, sum = 0;
		
		for (int i = 0; i < n; i++)
		{
			cin >> A[i]; su += A[i];
		}

		int m = su / n;
		for (int i = 0; i < n; i++)
		{
			if (A[i] <= m) sum++;
		}
		cout << sum << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
    int n,sum,counter;
    float average;
    int An[10000];
    while(1){
        scanf("%d",&n);
        if(n == 0) break;
        for(int i=0;i<n;i++){
            scanf("%d",&An[i]);
        }
        sum = 0;
        for(int i=0;i<n;i++){
            sum += An[i];
        }
        average = sum/n;
        counter = 0;
        for(int i=0; i<n; i++){
            if(An[i]<=average){
                counter += 1;
            }
        }
        printf("%d\n",counter);
    }
    return 0;
}