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++: /*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b) {
  return b ? GCD(b,a%b) : a;
}


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  while(1){
    ll n;
    cin>>n;
    if(n==0) return 0;
    vector<ll> v(n);
    rep(i,n) cin>>v[i];
    double ave=Svec(v)/n;
    sort(ALL(v));
    bool flag=true;
    rep(i,n){
      if(v[i]>ave){
        cout<<i<<endl;
        flag=false;
        break;
      }
    }
    if(flag) cout<<n<<endl;
  }
}

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

int main() {
	int n, sum = 0;
	while (true) {
		cin >> n;
		if (n == 0) break;
		else {
			vector<int>a(n);
			for (int i = 0; i < n; i++) {
				cin >> a.at(i);
				sum += a.at(i);
			}
			double ave = sum / n;
			int ans = 0;
			for (int i = 0; i < n; i++) {
				if (a.at(i) <= ave) ans++;
			}
			cout << ans << endl;
		    n = 0, sum = 0, ave = 0;
		    for (int i = 0; i < n; i++) {
			a.at(i) = 0;
		    }
		}
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>
#include<list>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

ll mypow(ll x,ll n){
    ll ret = 1;
    while(n > 0){
        if(n&1){
            ret = (ret*x)%MOD;
        }
        x = (x*x)%MOD;
        n >>= 1;
    }
    return ret;
}

ll solve(ll n){
    vector<ll> a(n);
    for(auto &x:a){
        cin >> x;
    }
    ll sum = 0;
    for(auto &x:a){
        sum += x;
    }
    ll ret = 0;
    for(auto &x:a){
        if(n*x <= sum){
            ++ret;
        }
    }
    return ret;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    vector<ll> ans;

    while(true){
        ll n;
        cin >> n;
        if(n == 0){
            break;
        }
        ans.push_back(solve(n));
    }

    for(auto &x:ans){
        cout << x << endl;
    }

    return 0;
}

C++: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 100000

int N;
double table[NUM];

void func(){

	double sum = 0;

	for(int i = 0; i < N; i++){
		scanf("%lf",&table[i]);
		sum += table[i];
	}

	int ans = 0;

	double average = sum/(double)N;

	for(int i = 0; i < N; i++){
		if(table[i] <= average){
			ans++;
		}
	}

	printf("%d\n",ans);
}

int main(){

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func();
	}

	return 0;
}

C++: #include <iostream>  
#include <algorithm>  
#include <functional>  
#include <vector>  
#include <map>
#include <string>
#include <queue>
#include <deque> 
#include <cmath>
using namespace std;
#define _USE_MATH_DEFINES
#include <math.h>
int main(){
	int n;
	while(scanf("%d",&n)){
		if(n==0) break;
		long long int sum=0;
		int i;
		int a[10005];
		for(i=1;i<=n;i++){
			scanf("%d",&a[i]);
			sum+=a[i];
		}
		sort(a+1,a+n+1);
		sum=sum/n;
		int pos=upper_bound(a+1,a+n+1,sum)-a;
		printf("%d\n",pos-1 );
	}
	return 0;
}

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

int main() {
    int n;
    while (cin >> n, n) {
        vector<int> vec(n);
        for (auto& i : vec) cin >> i;
        int sum = 0;
        for (auto i : vec) sum += i;

        int count = 0;
        for (auto i : vec)
            if (i <= sum / n) count++;

        cout << count << endl;
    }

    return 0;
}

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

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

    while(true){
        int n; cin>>n;
        if(n==0)break;
        vector<Int> a(n,0); for (int i = 0; i < n; i++)cin>>a[i];
        Int ave=accumulate(a.begin(), a.end(),0)/n;
        int ans=0;
        for (int i = 0; i < n; i++) if(a[i]<=ave)ans++;
        cout<<ans<<'\n';
    }
}

C++: #include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<numeric>
#include<map>
#include<limits>
using namespace std;

#define R(i,s,n) for(int i=s;i<n;i++)
#define D(i,n,s) for(int i=n-1;i>=s;i--)
typedef pair<int,int> P;
typedef unsigned long long ull;
typedef long long ll;

int main() {
  int n;
  while (cin >> n && n) {
    int a[n];
    int sum = 0;
    R(i,0,n) {
      cin >> a[i];
      sum += a[i];
    }
    sum /= n;
    int cnt = 0;
    R(i,0,n) {
      if (a[i] <= sum) {
        cnt++;
      }
    }
    cout << cnt << endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int a[10001];
    double sum=0;
    for(int i=0;i<n;i++){
      cin>>a[i];
      sum+=a[i];
    }
    double ave=sum/(double)n;
    int ans=0;
    for(int i=0;i<n;i++) if(a[i]<=ave) ans++;
  	cout<<ans<<endl;
  }
  return 0;
}