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<cstdlib>
#include<cstring>
using namespace std;


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

C++: #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    while(N){
        vector<int> V(N);
        rep(i,0,N)cin >> V[i];
        ll sum = 0;
        rep(i,0,N)sum += V[i];
        int cnt = 0;
        rep(i,0,N)if(V[i] <= sum / N)cnt++;
        cout << cnt << endl;
        cin >> N;
    }
}

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

int n,a[100001];

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

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

int main(){
    int n;
    while(cin >> n, n){
        vector<int> A(n);
        for(auto &v: A)
            cin >> v;
        
        int sum = 0;
        for(auto v: A)
            sum += v;
        
        int count = 0;
        for(auto v: A)
            count += v*n <= sum;
        
        cout << count << endl;
    }
    
    return 0;
}

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

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

typedef long double ld;

double a[10005];
ld sum = 0, avg = 0;

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

	int cnt;

	while (n != 0) {
		sum = 0;
		cnt = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
			sum += a[i];
		}
		avg = sum / (double)n;
		for (int i = 0; i < n; i++) {
			if (a[i] <= avg) {
				cnt++;
			}
		}
		cout << cnt << endl;
		cin >> n;
	}

	return 0;
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

using namespace std;

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

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




}
    return 0;
}

C++: 
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>
#include <sstream>

#define all_range(C) std::begin(C), std::end(C)



long long A[50000];
int main()
{
	using std::endl;
	using std::cout;
	using std::cin;

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

		long long sum = 0;
		for (int i = 0; i < n; ++i) {
			cin >> A[i];
			sum += A[i];
		}
		long long ave = sum / n;
		int count = 0;
		for (int i = 0; i < n; ++i) {
			if (A[i] <= ave) {
				++count;
			}
		}
		cout << count << endl;
	}

	return 0;
}
#endif

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

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

C++: #include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<31)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
//int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int n;
int a[10010];

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

C++: #include <vector>
#include <cstdio>
int main(){
	int N,r,s,i;
	for(;~scanf("%d",&N)&&N;printf("%d\n",r)){
		std::vector<int>a(N);
		for(s=i=0;i<N;i++)scanf("%d",&a[i]),s+=a[i];
		for(r=i=0;i<N;i++)r+=a[i]*N<=s;
	}
}