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<bits/stdc++.h>
using namespace std;

#define rep(i,n) for(long long i = 0; i < n; i++)
#define REP(i,s,n) for(long long i = (s); i <= (n); i++)
#define repr(i,n) for(long long i = n - 1; i >= 0; i--)
#define REPR(i,s,n) for(long long i = (s); i >= (n); i--)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sumvec(v) accumulate(all(v), 0LL)
#define pb push_back
#define DOUBLE fixed << setprecision(15)
#define OK cerr << "OK\n"
#define OK1 cerr << "OK1\n"
#define OK2 cerr << "OK2\n"
#define sz(s) (long long)s.size()
#define INF ((1LL << 62) - (1LL << 31))
#define zero(x, n) setw(x) << setfill('0') << n
//#define endl '\n'

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vd> vvd;
typedef vector<vc> vvc;
typedef vector<vb> vvb;
typedef pair<ll,ll> P;
typedef vector<P> vP;

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
    ost << "{" << p.first << ", " << p.second << "} ";
    return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
    ost << "{";
    for (int i = 0; i<(int)v.size(); i++) {
        if (i)ost << " ";
        ost << v[i];
    }
    ost << "} \n";
    return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
    ost << "{";
    for (auto p:v) {
        ost << "{" << p.first << ", " << p.second << "} ";
    }
    ost << "} ";
    return ost;
}

void out(){cout << "\n";}
template<class T,class... Args>
void out(const T &x,const Args &... args){
    cout << x << " ";
    out(args...);
}

template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& e: vec) is >> e;
    return is;
}

template<typename T>
string join(vector<T>& vec, string sep=" "){
    stringstream ss;
    for(int i=0;i<(int)vec.size();i++){
        ss << vec[i] << (i+1==(int)vec.size()?"\n":sep);
    }
    return ss.str();
}

template<class T>
inline bool chmax(T& a, T b){if(a<b){a=b;return true;} return false;}

template<class T>
inline bool chmin(T& a, T b){if(a>b){a=b;return true;} return false;}

#define INT(...) int __VA_ARGS__;IN(__VA_ARGS__)
#define LL(...) long long __VA_ARGS__;IN(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__;IN(__VA_ARGS__)
#define DBL(...) double __VA_ARGS__;IN(__VA_ARGS__)
#define STR(...) string __VA_ARGS__;IN(__VA_ARGS__)
#define LD(...) long double __VA_ARGS__;IN(__VA_ARGS__)

void scan(int& a){ cin >> a; }
void scan(long long& a){ cin >> a; }
void scan(char& a){ cin >> a; }
void scan(double& a){ cin >> a; }
void scan(string& a){ cin >> a; }
void scan(long double& a){ cin >> a; }

void IN(){}
template<class Head,class... Tail> void IN(Head& head,Tail&... tail){ scan(head); IN(tail...); }

void YES(bool b) {cout << ((b)?"YES\n":"NO\n");}
void Yes(bool b) {cout << ((b)?"Yes\n":"No\n");}
void yes(bool b) {cout << ((b)?"yes\n":"no\n");}
void Yay(bool b) {cout << ((b)?"Yay!\n":":(\n");}

const long double pi = acos(-1.0);
const ll mod=1000000007;
//const ll mod=998244353;

ll powmod(ll a,ll b){ll c=1; while(b>0){ if(b&1){ c=a*c%mod; } a=a*a%mod; b>>=1; } return c;}
ll nCrmod(ll n,ll r){ll x=1,y=1; for(ll i=0;i<r;i++) {x=x*(n-i)%mod; y=y*(i+1)%mod; } return x*powmod(y,mod-2)%mod;}
ll gcd(ll a,ll b){ while(b){ ll c=b; b=a%b; a=c; } return a; }
ll lcm(ll a,ll b){ if(!a || !b) return 0; return a*b/gcd(a,b); }
vll divisor(ll x){ vll v; for(int i=1;i*i<=x;i++)if(x%i==0){ v.pb(i);if(i*i!=x)v.pb(x/i); } sort(all(v)); return v; };
map<ll,ll> prime_factor(ll n){ map<ll,ll> m; for(ll i=2;i*i<=n;i++){ while(n%i==0){ m[i]++; n/=i; } } if(n!=1) m[n]=1; return m; }

int main()
{
    ll n;
    while(cin >> n, n) {
        vll a(n);
        cin >> a;
        ll sum = sumvec(a);
        ll ans = 0;
        for(auto&& e : a) {
            if(e * 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 a[10000];
    double 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++)ans+=s/n>=a[i];
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <functional>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;

int main(){
  int n;
  while(1){
    cin >> n;
    if(n==0) break;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    sort(a.begin(),a.end());
    int sum=0;
    rep(i,n) sum += a[i];
    int avg = sum / n;
    rep(i,n) {
      if(a[i]>avg) {cout << i << endl;break;}
      if(i==n-1) cout << n << endl;
    }
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
 
bool solve() {
    int N;
    cin >> N;
    if(!N) return false;
 
    vector<int> A(N);
    int sum = 0;
    for(int &e : A) {
        cin >> e;
        sum += e;
    }
 
    int ans = 0;
    for(int i = 0; i < N; i++) if(N * A[i] <= sum) ans++;
    cout << ans << endl;
    return true;
}
 
int main() {
    while(solve());
    return 0;
}

C++: 
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
void init(){
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int n;
int sum=0;
int a[110000];

int main(){
  while(true){

    cin>>n;
    if(n==0) break;
    rep(i,n){
      cin>>a[i];
      sum+=a[i];
    }
    sum/=n;

    int asn=0;
    rep(i,n){
      if(sum<=a[i])
        asn++;
    }

    cout<<asn<<endl;
  }
}

C++: #include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;

int main(void){
    while(true){
        int n; cin >> n;
        if(n == 0) return 0;
        else{
            vector<int> person(n);
            double ave = 0;
            REP(i, n){
                cin >> person[i];
                ave += person[i];
            }
            ave /= n;
            int count = 0;
            REP(i, n){
                if(ave >= person[i]) count++;
            }
            cout << count << endl;
        }       
    }
}