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

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

using namespace std;

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

int n;
vector<int> a;

void solve() {
    double avg = 0;
    rep(i, n) avg += a[i];
    avg /= n;
    int ans = 0;
    rep(i, n) if (a[i] <= avg) ans++;
    cout << ans << endl;
}

int main() {
    while(cin >> n, n) {
        a.clear();
        a.resize(n);
        rep(i, n) cin >> a[i];
        solve();
    }
}

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


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

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define MAX 100100

int n;
int a[MAX];

int main() {
  scanf("%d", &n);

  while(n) {
    int average = 0, cnt = 0;
    for(int i=0; i<n; ++i) {
      scanf("%d", &a[i]);
      average += a[i];
    }

    average /= n;

    for(int i=0; i<n; ++i)
      if(a[i]<=average) ++cnt;

    printf("%d\n", cnt);
    scanf("%d", &n);
  }

  return 0;
}

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

int main() {
	while (true) {
		double n;
		cin >> n;
		if (n == 0) break;
		vector<int> a(n);
		for (int i = 0; i < n; i++) cin >> a[i];

		double sum = 0;
		for (int i = 0; i < n; 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;
	}
}

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

#define int long long

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  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++ ) {
      if ( a[i]*n <= sum ) ans++;
    }

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

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

int main(){
  int n;
  while(cin>>n && n){
    int sum=0;
    vector<int> t(n);
    for(int i=0;i<n;i++){
      cin>>t[i];
      sum+=t[i];
    }
    int ans=0;
    for(int i=0;i<n;i++){
      if( t[i]*n <= sum )ans++;
    }
    cout<<ans<<endl;
  }
  
  return 0;
}

C++: #include<bits/stdc++.h>
#define MAX 10005
using namespace std;
double a[MAX];
int main()
{
    int n;
    while(scanf("%d",&n)!=EOF&&n)
    {
        double sum=0;
        int res=0;
        for(int i=0;i<n;i++)
        {
            scanf("%lf",&a[i]);
            sum+=a[i];
        }
        sum/=(double)n;
        for(int i=0;i<n;i++)
            if(a[i]<=sum)res++;
        printf("%d\n",res);
    }
}

C++: #include<iostream>
using namespace std;
int t[100005];
int main(){
	long long int n;
	int i,j,k;
	long long int a,b,c;
	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<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;

int main() {
	while (true) {
		double n;
		cin >> n;
		if (n == 0) break;
		vector<int> a(n);
		for (int i = 0; i < n; i++) cin >> a[i];

		double sum = 0;
		for (int i = 0; i < n; 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 << "\n";
	}
}

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

int main(){
    while(true){
        int n;
        cin>>n;
        if(!n)return 0;
        int a[n];
        double total=0;
        for(int i=0;i<n;i++){
            cin>>a[i];
            total += a[i];
        }
        double average=total/n;
        
        int lower_pep=0;
        for(int i=0;i<n;i++){
            if(a[i]<=average)lower_pep++;
        }
        cout<<lower_pep<<endl;
    }
}

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

int main(){
    int n;
    while(cin>>n){
        if(n==0){
            return 0;
        }
    vector<int> a(n,0);
    for(int i=0;i<n;i++){
        cin>>a.at(i);
    }
    int ave=0;
    for(int i=0;i<n;i++){
        ave+=a.at(i);
    }
    ave=ave/n;
    int ans=0;
    for(int i=0;i<n;i++){
        if(a.at(i)<=ave){
            ans++;
        }
    }
    cout<<ans<<endl;
    }
}

C++: #include <iostream>
using namespace std;
int main(void){
    int n, a[10000]={};
    long int sum;
    
    while(true){
        sum=0;
        cin >> n;
        if(n == 0) break;
        for(int i=0; i<n; i++){
            cin >> a[i];
            sum += a[i];
        }
        double ave = sum/n;
        int count = 0;
        for(int i=0; i<n; i++){
            if(ave >= a[i]) count++;
        }
        cout << count << endl;
    }
    return 0;
}

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

int main() {
  int n;
  while (cin >> n, n) {
    vector<int> a(n);
    int s = 0;
    for (auto &e : a) {
      cin >> e;
      s += e;
    }
    double m = (double)s / n;
    int r = 0;
    for (auto e : a) {
      r += e <= m;
    }
    cout << r << endl;
  }
}