Go: package main

import "fmt"

func main() {

     for ; true ; {
     var n int
     fmt.Scan(&n)
     if n == 0 { break }
     a := make([]float64, n)
     var sum float64 = 0
     for i := 0; i < n; i++ {
     	 fmt.Scan(&a[i])
	 sum += float64(a[i])
     }
     sum /= float64(n)
     ans := 0
     for i := 0; i < n; i++ {
     	 if a[i] <= sum {
	    ans += 1
	 }
     }
     fmt.Println(ans)
     }
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
    // Write Your Code Below
    while(1){
        int n; cin >> n;
        if(n==0) break;
        vector<int> v(n);
        ll sum=0;
        for(int i=0;i<n;i++){
            cin >> v[i];
            sum+=v[i];
        }
        double ave=(double)sum/n;
        int cnt=0;
        for(int i=0;i<n;i++){
            if(v[i]<=ave) cnt++;
        }
        cout << cnt << endl;
    }

}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define FORR(I,A,B) for(ll I = ((B)-1); I >= (A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=1e18+7;
const ll MOD=1e9+7;
#define pri(a) cout << (a) << endl

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll N;
	while(1){
		cin >> N;
		if(N==0)break;
		vector<ll> A(N);
		ll w = 0,ans = 0;
		FOR(i,0,N){
			cin>>A[i];
			w += A[i];
		}
		FOR(i,0,N){
			if(w>=A[i]*N)ans++;
		}
		cout << ans << endl;
	}
}

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

using namespace std;

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

C++: #define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>  
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000000000000000000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
int main() {
	while (true) {
		int n;
		cin >> n;
		if (n == 0) return 0;
		vector<double> input;
		double sum = 0;
		REP(i, n) {
			double a;
			cin >> a;
			input.push_back(a);
			sum += a;
		}
		sum /= (double)n;
		int ans = 0;
		REP(i, n) {
			if (input[i] <= sum) ans++;
		}
		cout << ans << endl;
	}
}

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

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

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

int n,cnt;
int a[10005]={0};
double av,sum;

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

C++: #include<bits/stdc++.h>
#define endl '\n';
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr double INFD = 1e100;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
// ---------------------------------------------------------------------------

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;
    while(N!=0){
        double heikin = 0;
        vector<int> A(N);
        for(int i=0; i<N; i++){
            cin >> A[i];
            heikin += A[i];
        }
        heikin /= double(N);
        int cnt = 0;
        for(int i=0; i<N; i++){
            if(heikin >= A[i]) cnt++;
        }
        cout << cnt << endl;
        cin >> N;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int i,n,sum,cnt;
    int a[10000];
    
    while(1){
        cin >> n ;
        if(n == 0) break;
        
        sum = 0;
        
        for(i = 0;i < n;i++){
            cin >> a[i];
            sum += a[i];
        }
       // cout << sum;
        sum = sum / n;
        //cout << " " << sum << " ";
        cnt = 0;
        for(i = 0;i< n;i++){
            if(a[i] <= sum) cnt++;
        }
        
        cout << cnt << endl;
    }
}

C++: #include<bits/stdc++.h>
#define MAX 10001
#define inf 1<<29
#define linf (1e16)
#define eps (1e-8)
#define Eps (1e-12)
#define mod 1000000007
#define pi acos(-1.0)
#define phi (1.0+sqrt(5.0))/2.0
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define pd(a) printf("%.10f\n",(double)(a))
#define pld(a) printf("%.10Lf\n",(ld)(a))
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(a)-1;(b)<=i;i--)
#define Unique(v) v.erase(unique(all(v)),v.end())
#define equals(a,b) (fabs((a)-(b))<eps)
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<int,double> pid;
typedef pair<double,int> pdi;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<pii> vpi;

int main()
{
  int n;
  double a[MAX];
  while(cin>>n && n){
    double m=0;
    int ans=0;
    FOR(i,0,n){
      cin>>a[i];
      m+=a[i]/n;
    }
    FOR(i,0,n)
      if(m-a[i]>-eps)ans++;
    cout<<ans<<endl;
  }
  return 0;
}