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>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define vvc vector<vector<char> >
#define vvs vector<vector<string> >
#define P 1000000007
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const long long LLINF=1LL<<60;
//set<int>::iterator it;
//|\_
//g++ -std=c++1z temp.cpp
//./a.out





int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
    int n;
    while(1){
        cin>>n;
        if(n==0)break;
        int i,ans=0;
        vector<int> v(n,0);
        double sum=0;
        rep(i,n){
            cin>>v[i];
            sum+=v[i];
        }
        sum/=n;
        rep(i,n)if(v[i]<=sum)ans++;
        
        cout<<ans<<endl;
    }
//////////////////////////////////////////////////////
return 0;}

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

int main(){
  int income[10000];
  int n;
  while(1){
    cin >> n;
    if(n==0){
      break;
    }
    int total=0;
    for(int i=0;i<n;i++){
      cin >> income[i];
      total += income[i];
    }
    int ave = total/n;
    int cnt=0;
    for(int i=0;i<n;i++){
      if(ave>=income[i])
        cnt++;
      }
      cout << cnt << endl;
    }
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;

signed main(){
    int n;
    while(cin >> n, n){
        vector<int> a(n);
        int sum = 0;
        rep(i, 0, n){
            cin >> a[i];
            sum += a[i];
        }
        int ave = sum / n;
        int ans = 0;
        rep(i, 0, n){
            if(a[i] <= ave) ans++;
        }
        cout << ans << endl;
    }
}

C++: #include<iostream>
using namespace std;
int t[10005];
int main(){
	int n;
	int a,b,c;
	int i,j,k;
	while(cin>>n){
		if(!n)break;
		a=0;
		for(i=0;i<n;i++){
			cin>>t[i];
			a+=t[i];
		}
		a/=n,b=0;
		for(i=0;i<n;i++){
			if(t[i]<=a)b++;
		}
		cout<<b<<endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=998244353,MAX=100005,INF=1<<28;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    while(1){
        int N;cin>>N;
        int sum=0,cnt=0;
        if(N==0) break;
        
        vector<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]*N<=sum) cnt++;
        }
        
        cout<<cnt<<endl;
    }
}

C++: #include <iostream>
using namespace std;
int main()
{
	int N;
	int a[10000];
	int sum = 0;
	
	while (1)
	{
		sum = 0;
		cin >> N;
		if (N == 0) {
			return 0;
		}
		for (int i = 0; i < N; i++) {
			cin >> a[i];
			sum = sum + a[i];

		}
		int H;
		H = sum / N;
		int count = 0;
		for(int j=0; j<N; j++){
			
			if (a[j] <= H) {
				count = count + 1;
			}
			


		
			


		}
		cout << count << endl;

	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< vector<int> > Mat;
typedef tuple<int, int, int, int> T;

const int MOD = (int)1e9+7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

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

    int n;
    while(1){
        cin >> n;
        if(n == 0) break;
        vector<int> a(n);
        double ave = 0;
        rep(i, n){
            cin >> a[i];
            ave += a[i];
        }
        ave /= n;

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

        cout << ans << endl;
    }

    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define REP(i,b,e) for(int i=(b);i<(e);++i)
#define rep(i,e) for(int i=0;i<(e);++i)

int main() {
  int n;
  while(cin >> n){
    if(n==0) return 0;
    vector<int> v(n);
    rep(i, n) cin >> v[i];
    int sum = accumulate(v.begin(), v.end(), 0);
    int cnt = 0;
    rep(i, n){
      if(v[i]<=sum/n) cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}

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

int main() {
    while(true){
    double sum=0;
    double a[50000];
    double n;
    cin >> n;

    if(n==0)break;
    
    for(int i=0;i<n;i++){
        cin >> a[i];
        sum+=a[i];
    }
    double ave = sum/n;
    int cnt=0;
    for(int i=0;i<n;i++){
        if(ave>=a[i]){
            cnt++;
        }
    }

    cout << cnt<<endl;
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
typedef long long ll;
ll n,a[100000],ans,rans;
int main(void){
    while(1){
        rans=0;
        ans=0;
        cin>>n;
        if(n==0)return 0;
        for(int i=0;i<n;i++){
            cin>>a[i];
            ans+=a[i];
        }
        for(int i=0;i<n;i++){
            if(a[i]*n<=ans)rans++;
        }
        cout<<rans<<endl;
    }
}