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>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 100000

int N;
double table[NUM];

void func(){

	double sum = 0;

	for(int i = 0; i < N; i++){
		scanf("%lf",&table[i]);
		sum += table[i];
	}

	int ans = 0;

	double average = sum/(double)N;

	for(int i = 0; i < N; i++){
		if(table[i] <= average){
			ans++;
		}
	}

	printf("%d\n",ans);
}

int main(){

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func();
	}

	return 0;
}

C++: #include <iostream>  
#include <algorithm>  
#include <functional>  
#include <vector>  
#include <map>
#include <string>
#include <queue>
#include <deque> 
#include <cmath>
using namespace std;
#define _USE_MATH_DEFINES
#include <math.h>
int main(){
	int n;
	while(scanf("%d",&n)){
		if(n==0) break;
		long long int sum=0;
		int i;
		int a[10005];
		for(i=1;i<=n;i++){
			scanf("%d",&a[i]);
			sum+=a[i];
		}
		sort(a+1,a+n+1);
		sum=sum/n;
		int pos=upper_bound(a+1,a+n+1,sum)-a;
		printf("%d\n",pos-1 );
	}
	return 0;
}

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

int main() {
    int n;
    while (cin >> n, n) {
        vector<int> vec(n);
        for (auto& i : vec) cin >> i;
        int sum = 0;
        for (auto i : vec) sum += i;

        int count = 0;
        for (auto i : vec)
            if (i <= sum / n) count++;

        cout << count << endl;
    }

    return 0;
}

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

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

    while(true){
        int n; cin>>n;
        if(n==0)break;
        vector<Int> a(n,0); for (int i = 0; i < n; i++)cin>>a[i];
        Int ave=accumulate(a.begin(), a.end(),0)/n;
        int ans=0;
        for (int i = 0; i < n; i++) if(a[i]<=ave)ans++;
        cout<<ans<<'\n';
    }
}

C++: #include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<numeric>
#include<map>
#include<limits>
using namespace std;

#define R(i,s,n) for(int i=s;i<n;i++)
#define D(i,n,s) for(int i=n-1;i>=s;i--)
typedef pair<int,int> P;
typedef unsigned long long ull;
typedef long long ll;

int main() {
  int n;
  while (cin >> n && n) {
    int a[n];
    int sum = 0;
    R(i,0,n) {
      cin >> a[i];
      sum += a[i];
    }
    sum /= n;
    int cnt = 0;
    R(i,0,n) {
      if (a[i] <= sum) {
        cnt++;
      }
    }
    cout << cnt << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int a[10001];
    double sum=0;
    for(int i=0;i<n;i++){
      cin>>a[i];
      sum+=a[i];
    }
    double ave=sum/(double)n;
    int ans=0;
    for(int i=0;i<n;i++) if(a[i]<=ave) ans++;
  	cout<<ans<<endl;
  }
  return 0;
}

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

int main(int argc, char const *argv[])
{
	int n;
	while(cin>>n,n)
	{
		int a[n],s=0;
		for (int i = 0; i < n; ++i) cin>>a[i],s+=a[i];
		double v=(double)s/n;
		int ans=0;
		for (int i = 0; i < n; ++i) if((double)a[i]<v+0.000001) ++ans;
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
    // Write Your Code Below
    while(1){
        int n; cin >> n;
        if(n==0) break;
        vector<int> v(n);
        ll sum=0;
        for(int i=0;i<n;i++){
            cin >> v[i];
            sum+=v[i];
        }
        double ave=(double)sum/n;
        int cnt=0;
        for(int i=0;i<n;i++){
            if(v[i]<=ave) cnt++;
        }
        cout << cnt << endl;
    }

}

C++: #include<bits/stdc++.h>
using namespace std;
#define BIG 1000000007
#define ll long long int

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

C++: //12/11アルゴリズム
#include<iostream>
using namespace std;

int main(){
  while(true){
    int n;
    cin>>n;

    if(n==0)break;

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

    int avarage=sum/n;
    int poor=0;

    for(int i=0;i<n;i++){
      if(a[i]<=avarage){
        poor++;
      }
    }

    cout<<poor<<endl;
  }
  return 0;
}