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>

#define ARC(i, a, b) for(int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)

template<typename T> T ant(const T &a, const T &b){ return a > b ? a : b; }
template<typename T> T ont(const T &a, const T &b){ return a < b ? a : b; }
template<typename T> T rng(const T &a, const T &b){ return a > b ? a - b : b - a; }
template<typename T> T &anth(T &a, const T &b){ return a = ant(a, b); }
template<typename T> T &onth(T &a, const T &b){ return a = ont(a, b); }

template<typename T> T make_v(T val){ return val; }
template<typename... Ts> auto make_v(size_t n, Ts... ts){ return std::vector<decltype(make_v(ts...))>(n, make_v(ts...)); }

int main(){
	int n;
	while(scanf("%d", &n), n){
	int a[12345], av = 0, cnt = 0;
	RC(i, n){
		scanf("%d", a + i);
		av += a[i];
	}
	av /= n;
	RC(i, n) cnt += a[i] <= av;
	printf("%d\n", cnt);
	}
}

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++: #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 <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
const double EPS = 1e-9;
const ll mod = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;

int n;
ll a[10000];

void solve() {
    rep(i,n) cin >> a[i];
    ll x = 0;
    rep(i,n) x += a[i];
    int ans = 0;
    rep(i,n) if (a[i]*n <= x) ans++;
    cout << ans << endl;
}

int main() {
#ifndef LOCAL
    ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
    cout.precision(20);
    cerr << fixed;
    cerr.precision(6);
#ifdef LOCAL
    //freopen("in.txt", "wt", stdout); //for tester
    freopen("in.txt", "rt", stdin);
#endif  
    while (cin >> n) {
        if (n == 0) break;
        solve();
    }
    //cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}

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

   int main(){
    int n=0;

    while(1){
      cin>>n;

      if(n==0){
        break;
      }

      int p[n];
      int total=0;
      for(int i=0;i<n;i++){
        cin>>p[i];
        total=total+p[i];
      }

      int ave;
      ave=total/n;
      int lesspeople=0;
      for(int j=0;j<n;j++){
        if(ave>=p[j]){
          lesspeople++;
        }
      }
      cout<<lesspeople<<"\n";


    }

    return 0;
   }

C++: #include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	ll n;
	while(cin>>n, n!=0){
		vll a(n);
		ll asum=0;
		double ave;
		rep(i, n){
			cin >> a[i];
			asum += a[i];
		}
		ave = (double)asum/n;
		ll ans=0;
		rep(i, n){
			if (a[i] <= ave) ans++;
		}
		cout << ans << "\n";
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< vector<int> > Mat;
typedef tuple<int, int, int, int> T;

const int MOD = (int)1e9+7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

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

    int n;
    cin >> n;
    vector<int> a(n);
    double ave = 0;
    rep(i, n){
        cin >> a[i];
        ave += a[i];
    }
    ave /= n;

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

    cout << ans << endl;


    return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<tuple>
#include<utility>
#include<stack>
#include<set>
#include<iomanip>
using namespace std;
using ll=long long int;

int main() {

	int n;
	while (cin >> n, n != 0) {
		int sum = 0;
		vector<int>a(n);
		for (int i = 0; i < n; i++) {

			cin >> a[i];
			sum += a[i];
		}
		int cnt = 0;
		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;
#define REP(i,n) for(int64 i = 0; i < (n); i++)
using int64 = int_fast64_t;
int main(void){
  cin.tie(0);

  int n;
  while(cin >> n && n){
    int a[n];
    double ave = 0;
    REP(i,n){
      cin >> a[i];
      ave += a[i];
    }
    ave /= n;
    int cnt = 0;
    REP(i,n){
      if(a[i] <= ave)cnt++;
    }
    cout << cnt << endl;
  }
}