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 <algorithm>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(i, x, n) for (int i = (x); i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define int long long
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e8;
template<typename T> void cmax(T &a, T b) { a = max(a, b); }
template<typename T> void cmin(T &a, T b) { a = min(a, b); }

signed main() {
  int n;
  while (cin >> n, n) {
    vector<int> a(n);
    int sum = 0;
    rep(i, n) {
      cin >> a[i];
      sum += a[i];
    }
    double avg = (double)sum / n;
    int ans = 0;
    rep(i, n) { ans += (a[i] <= avg); }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <deque>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <set>
using namespace std;
int main(void){
    int x;
    cin >> x;
    while(x!=0){
        int total = 0;
    vector<int> a(x);
    int ans = 0; 
    for(int j=0;j<x;j++){
        cin >> a[j];
        total+=a[j];
    }
    total = total/x;
    for(int j=0;j<x;j++){
        if(total>=a[j]){
            ans++;
        }
    }
    cout << ans << endl;
    cin >> x;
    }
}

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

using namespace std;

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

C++: #include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

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

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

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

int main() {
    while(1){
	    int n; cin >> n;
        if(n==0) return 0;
        vector<int> a(n);
	    int sum=0;
        for(int i=0; i < n; i++){
            cin >> a[i];
            sum += a[i];
        }
        sum /= n;
        int cnt=0;
        for(int i=0; i < n; i++){
            if(a[i] <= sum) cnt++;
        }
        cout << cnt << endl;
    }
}
//./test < in > out

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

int main(void)
{
    int Members, Scores[10000], Total = 0, Poors = 0, i;

    while(true)
    {
        cin >> Members;
        if(!Members){ break; }
        for(i = 0; i < Members; i++)
        {
            Scores[i] = 0;
            cin >> Scores[i];
            Total = Total + Scores[i];
        }
        // Average = Total / Members;
        for(i = 0; i < Members; i++)
        {
            if(Scores[i] * Members <= Total){ Poors++; }
        }
        cout << Poors << "\n";
    }
}

C++: #include <cstdio>
#include <cctype>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;

#define _gp(l) const auto gcu{getchar##l}; const auto pcu{putchar##l}
#ifdef __linux
_gp(_unlocked);
#else
_gp();
#endif
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template <typename T>
#define _HT template <typename H,typename... T>
_T _DEF(T,in,int c){T n=0;int m=1;while(isspace(c)){c=gcu();}if(c=='-')m=-1,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
_DEF(int,in,){return in<int>(gcu());}
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
_T _SCAN(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_DEF(bool, scan, int &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_SCAN(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=(char)c;}}
#endif
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);} _OUT(const char *s){while(*s)pcu(*s++);} _OUT(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_OUT(string s){for(char c:s)pcu(c);}
#endif
_T _OUT(T n){static char b[20];char *p=b;T m=n<0?pcu('-'),-1:1;
	if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}
_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _OUT(vector<T> v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}
#endif
_HT _OUT(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _OUTL(T&&... t){out(move(t)...);outl();}
struct range{
	int e,b=0,s=1; range(int _b,int _e,int _s):e(_e),b(_b),s(_s){} range(int _b,int _e): e(_e), b(_b){} range(int _e):e(_e){}
	struct it { int v, s; it (int _v, int _s) : v(_v), s(_s) {} operator int()const{return v;} operator int&(){return v;} int operator*()const{return v;}
		it& operator++(){v+=s;return *this;} }; it begin() {return {b, s};} it end() {return {e, s};}};

int main() {
	for (int n; (n = in());) {
		vector<double> A(n);
		double s {};
		for (auto &a: A)
			s += a = in();
		s /= n;
		outl(count_if(begin(A), end(A), [s](auto a) {return a <= s;}));
	}
}

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

using namespace std;


int a[100005];

int main(){
    int n;
    while(cin >> n, n){
        long long s = 0;
        for(int i = 0; i < n; ++i){
            cin >> a[i];
            s += a[i];
        }
        int ret = 0;
        for(int i = 0; i < n; ++i){
            if(s >= a[i]*n) ++ret;
        }
        cout << ret << endl;
        
    }
}