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>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;

int main(void){
    while(true){
        int n; cin >> n;
        if(n == 0) return 0;
        else{
            vector<int> person(n);
            double ave = 0;
            REP(i, n){
                cin >> person[i];
                ave += person[i];
            }
            ave /= n;
            int count = 0;
            REP(i, n){
                if(ave >= person[i]) count++;
            }
            cout << count << endl;
        }       
    }
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<math.h>
using namespace std;
#define mod (1000000000+7)
#define N (10007)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;


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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

int main(){
    int n;
    while(cin >>n,n){
        vector<int> a(n);
        rep(i,n) cin >>a[i];

        int s = 0;
        rep(i,n) s += a[i];

        int ans = 0;
        rep(i,n) ans += (a[i]*n <= s);
        cout << ans << endl;
    }
    return 0;
}

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

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

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

 #define int long long
 using namespace std;

int a[100020];
void solve(){
	int n;
	cin>>n;
//	cout<<" "<<n<<endl;
	int sum=0;
	if(n==0) exit(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(a[i]*n<=sum)ans++;
	}
	cout<<ans<<endl;
	return;
}

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

 
    	
    	for(int i=0;;i++){
    		solve();
    	
    	}
    	return 0;
    	
            }

C++: #include <bits/stdc++.h>
#define LL long long
using namespace std;
int a[10005];
int main()
{
    int n,i,j,k,all;
    scanf("%d",&n);
    while(n!=0)
    {
        all=k=0;
        for(i=1;i<=n;i++)
        {
            a[i]=0;
            scanf("%d",&a[i]);
            all+=a[i];
        }
        all=all/n;
        for(i=1;i<=n;i++)
        {
            if(a[i]<=all)
                k++;
        }
        printf("%d\n",k);
        scanf("%d",&n);
    }
    return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, a[n], ans, mean;

    while (true) {
        ans  = 0;
        mean = 0;
        cin >> n;
        if (n == 0) {
            break;
        }
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            mean += a[i];
        }
        mean /= n;
        for (int i = 0; i < n; i++) {
            if (a[i] <= mean) {
                ans++;
            }
        }
        cout << ans << endl;
    }
}

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

int main()
{
	int n;
	while (cin >> n, n) {
		int sum = 0;
		vector<int> a(n);
		for (int i = 0; i < n; i++) {
			cin >> a[i]; sum += a[i];
		}
		int res = 0;
		for (int i = 0; i < n; i++) {
			res += (a[i] * n <= sum);
		}
		cout << res << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>


using namespace std;


#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)

int main() {
  while (true) {
    int n;
    cin >> n;
    if (n == 0) {
      break;
    }

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

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

    cout << count << endl;
    

  }
  
  

  return 0;
}

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



int main(){
  int n,i,sum=0,count=0;
  double mean;
  int a[10000];

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

C++: #include "bits/stdc++.h"
using namespace std;
#define int long long
#define endl '\n'
int mod=1e9+7;
int mod2=998244353;

signed main(){
  while(true){
    int n;
    cin>>n;
    if(!n)break;
    vector<int> a(n);
    double sum=0;
    for(int i=0;i<n;i++){
      cin>>a[i];
      sum+=a[i];
    }
    sum/=n;
    int ans=0;
    for(int i=0;i<n;i++){
      if(sum>=a[i])ans++;
    }
    cout<<ans<<endl;
  }
}