Go: package main

import "fmt"

func main() {
    var n int
    a := make([]float64, 10004)
    for {
        fmt.Scan(&n)
        if n == 0 { break }

        ave_num := 0.0
        for i := 0; i < n; i++ {
            fmt.Scan(&a[i])
            ave_num += a[i]
        }
        ave_num /= float64(n)
        cnt := 0
        for i := 0; i < n; i++ {
            if a[i] <= ave_num {
                cnt++
            }
        }
        fmt.Println(cnt)
    }
}

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;
        
    }
}

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;
    }
}