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;
using ll = long long;
 
signed
main(){
        int n;
        while(cin >> n && n!=0)
        {
                vector<double> a(n);
                double ave = 0;
                for(int i=0;i<n;i++)
                {
                        cin >> a[i];
                        ave += a[i];
                }
                ave = ave /(double)n;
 
                int cnt = 0;
                for(int i=0;i<n;i++)
                {
                        if(a[i] <= ave){
                                cnt++;
                        }
                }
                cout << cnt << endl;
        }
}

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

int main(){
    int n;
    while(cin >> n, n){
        int a[n];
        double ave = 0;
        for(int i = 0; i < n; i++)  cin >> a[i], ave += a[i];
        ave /= n;
        sort(a, a+n);
        cout << upper_bound(a,a+n,ave) - a << endl;
    }
    return 0;
}

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

using namespace std;

bool solve(){
    int n;
    cin>>n;
    if(n==0)return false;
    vector<int> a(n);
    long long s=0;
    for (int i = 0; i < n; ++i) {
        cin>>a[i];
        s+=a[i];
    }
    int ans=0;
    for (int i = 0; i < n; ++i) {
        if(a[i]*n<=s)++ans;
    }
    cout<<ans<<endl;
    return true;
}

int main(){
    while(solve());
    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);
        int heikin=0;
        for(int i=0;i<n;i++){
            cin >> a[i];
            heikin += a[i];
        }
        heikin/=n;
        int ans =0;
        for(int i=0;i<n;i++){
            if(a[i]<=heikin) ans++;
        }
        cout << ans <<endl;
    }    
}

C++: 
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<int,pii> pip;
int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a*b/gcd(a,b);
}


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