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>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

int N, A[10101];
//---------------------------------------------------------------------------------------------------
void _main() {
	while (cin >> N) {
		if (N == 0) return;
		rep(i, 0, N) cin >> A[i];

		int sm = 0;
		rep(i, 0, N) sm += A[i];

		int ans = 0;
		rep(i, 0, N) if (A[i] * N <= sm) ans++;
		printf("%d\n", ans);
	}
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){
    int n;
    vector<int> v;
    double ave;
    int result;
    while(cin>>n,n){
        v.resize(n);
        result = 0;
        ave = 0;
        REP(i,n){
            scanf("%d", &v[i]);
            ave += v[i];
        }

        ave /= n;
        REP(i,n){
            if(v[i]<=ave+0.0001){
                result++;
            }
        }

        cout << result << endl;
        
    }

    return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
#define MOD 1000000007
using namespace std;
signed main() {
  int N;
  while(cin>>N,N){
  vector<int> a(N);
  int avg = 0;
  for (int i=0;i<N;i++) {
    cin>>a[i];
    avg+=a[i];
  }
  avg/=N;
  int ans=0;
  for (int i=0;i<N;i++) {
    if(a[i]<=avg)ans++;
  }
  cout<<ans<<endl;
  }
}

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

int main(void){
    int n, a[10010], s = 0;
    while(1) {
        cin >> n;
        if (n == 0) break;
        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;
    }
}

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

int main(){
  while(true){
    ll n;
    cin>>n;
    if(n==0)break;
    vector<ll> a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    ll ave = accumulate(a.begin(), a.end(),0ll)/n;
    int cnt=0;
    for(auto num:a)if(num<=ave)cnt++;
    cout<<cnt<<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int main(){
	while(1){
		int n;
		cin>>n;
		if(n==0) break;
		vi a(n);
		int s=0;
		for(int i=0;i<n;i++){
			cin>>a[i];
			s+=a[i];
		}
		int res=0;
		for(int i=0;i<n;i++) if(n*a[i]<=s) res++;
		cout<<res<<endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define REP(i,i_len) for (ll i = 0, i##_len = (i_len); i < i##_len; i++)

int main() {

    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll n;
    while (cin >> n, n) {

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

    }

}

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

using namespace std;

bool solve() {
    int N;
    cin >> N;
    if (N == 0) return false;

    vector<int> A(N);
    for (auto& a : A) cin >> a;

    int sum = accumulate(A.begin(), A.end(), 0);
    int ans = 0;
    for (auto a : A) {
        if (a * N <= sum) ++ans;
    }
    cout << ans << endl;
    return true;
}

int main() {
    while (solve()) {}
    return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
    int n;
    while(true){
        cin>>n;
        if(n==0){
            break;
        }
        int a[500010],sum=0,cnt=0;
        for(int i=0;i<n;++i){
            cin>>a[i];
            sum+=a[i];
        }
        for(int i=0;i<n;++i){
            if(n*a[i]<=sum){
                cnt++;
            }
        }
        cout<<cnt<<endl;
    }

    return 0;
}

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

int main(){
    int n;
    cin >> n;
    while(n > 0){
        vector<int> a(n);
        for(int i=0; i<n; i++) cin >> a[i];
        long long sm = accumulate(a.begin(), a.end(), 0LL);
        int ans = 0;
        for(int i=0; i<n; i++)if(sm/n >= a[i]) ans++;
        cout << ans << endl;
        cin >> n;
    }
}

C++:  #include <bits/stdc++.h>
 using namespace std;
 
 double a[500000];
 
 int main() {
          int n;
          double mean;
           int ans;
          while(true) {
                  cin >> n;
                  if (n == 0) break;
 
                  for(int i = 0;i < n;i++) cin >> a[i];
 
                  mean = 0;
                  ans = 0;
 
                  for(int i = 0;i < n;i++) mean += a[i];
 
                  mean /= n;
 
                  for(int i = 0;i < n;i++) {
                          if (a[i] <= mean) ans += 1;
                  }
 
                  cout << ans<< "\n";
          }
  }

C++: #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }


int N, A[10101];
//---------------------------------------------------------------------------------------------------
void _main() {
	while (cin >> N) {
		if (N == 0) return;
		rep(i, 0, N) cin >> A[i];

		int min = 0;
		rep(i, 0, N) min += A[i];

		int answer = 0;
		rep(i, 0, N) if (A[i] * N <= min) answer++;
		printf("%d\n", answer);
	}
}